Commit 90ad7f1
docs: respect banner expires field (#602)
## Summary
- Honors the new optional `expires` (ISO-8601) field in
[jdx.dev/banner.json](https://jdx.dev/banner.json)
- Banner is hidden once `Date.now() >= Date.parse(expires)`
- No-op when `expires` is absent (preserves existing behavior)
- Requires [jdx/blog#65](jdx/blog#65) to
populate the field
## Test plan
- [ ] Set an `expires` in the past → banner hidden
- [ ] Set an `expires` in the future → banner shown
- [ ] No `expires` field → banner shown as before
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Low risk: small, client-side docs banner change that only gates
rendering based on an optional timestamp; no auth or data writes beyond
existing localStorage usage.
>
> **Overview**
> Adds support for an optional `expires` field in `banner.json` so the
docs site announcement banner will **not render once the timestamp has
passed**.
>
> Introduces `isExpired()` to safely parse the date (treating
missing/invalid values as non-expired) and checks it during
`initBanner()` before calling `render()`.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
b64256d. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 2661934 commit 90ad7f1
1 file changed
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
26 | 35 | | |
27 | 36 | | |
28 | 37 | | |
| |||
0 commit comments