site: news nav link with "N NEW" chip + dasImgui announcement - #2907
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a top-nav news link that anchors to the landing page “Recent activity” section and introduces a “N NEW” nav chip for news entries (mirroring the existing blog chip). This is implemented via a generated files/news-meta.json (from the site builder) and a new news-counter.js that tracks “last seen” via localStorage.
Changes:
- Added
newsnav links across hand-authored pages + anchored landing section viaid="news". - Introduced
site/files/news-counter.jsand wired it into pages that already load the blog chip logic. - Extended
site/blog/build_blog.pyto emitfiles/news-meta.json, and added a new_newsannouncement entry.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| site/playground/index.html | Adds news link in playground top nav pointing back to ../index.html#news. |
| site/index.html | Adds news nav link, anchors the “Recent activity” section with id="news", and loads news-counter.js. |
| site/files/news-counter.js | New script to render/clear a “N NEW” chip for the news nav link using news-meta.json + localStorage. |
| site/downloads.html | Adds news nav link and loads news-counter.js. |
| site/daspkg.html | Adds news nav link (no chip script on this page). |
| site/blog/template.html | Adds news nav link for generated blog pages and loads news-counter.js. |
| site/blog/build_blog.py | Emits files/news-meta.json alongside existing feed JSON outputs. |
| site/.gitignore | Ignores generated files/news-meta.json. |
| site/_news/2026-05-27-0-6-3-is-just-around-the-corner-in-the.md | Adds a new news announcement entry (front-matter only). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -14,6 +14,8 @@ | |||
| news/<slug>.html — one per news entry that has a body | |||
| changelist.html — full long-form news list (all entries by date desc) | |||
| files/news.json — top-N news for forge.js to render landing § 05 | |||
There was a problem hiding this comment.
Fixed in 23ed407 — build_blog.py:16 docstring now says § 06. Same pre-existing stale comment in site/files/forge.js:497 (the actual renderer for the news feed) bumped at the same time.
- index.html: add id="news" to § 06 "Recent activity" so the nav link anchor-jumps there. Add `news` link to forge-nav__links before `docs`. Wire `files/news-counter.js`. - downloads.html, daspkg.html, playground/index.html, blog/template.html: same `news` nav link (anchors to index.html#news from non-landing pages). downloads + blog/template also pick up the counter script (matching the existing scope of blog-counter.js — daspkg and playground are skipped for both, preserving the prior pattern). - files/news-counter.js: new — mirrors blog-counter.js. Reuses `.forge-blog-chip` CSS class. Matches nav anchors by `link.hash === "#news"` so the same script works from any page. Marks seen via localStorage["daslang:news:lastSeen"] on landing-with-#news-hash AND on nav-link click; clears chips on click. - blog/build_blog.py: emit `files/news-meta.json` alongside `news.json` / `blog.json`. Same shape as blog.json (newest_date, baseline_date, items). - .gitignore: list `files/news-meta.json` as a build artifact. - _news/2026-05-27-0-6-3-is-just-around-the-corner-in-the.md: new entry announcing 0.6.3 + dasImgui's imgui_playwright addition. Links to https://borisbat.github.io/dasImgui/. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
newslink in the top nav (beforedocs) on every hand-authored page — anchor-jumps to § 06 "Recent activity" on the landing.files/news-meta.jsonand a newfiles/news-counter.js. Marks seen on landing-with-#news-hash OR on click of the nav link; localStorage keydaslang:news:lastSeen._newsentry: "0.6.3 is just around the corner. In the meantime, check out dasImgui — now with imgui_playwright." linking to https://borisbat.github.io/dasImgui/Changes
id="news"added to § 06 ofsite/index.html.<a href=".../index.html#news">news</a>inserted beforedocsinindex.html,downloads.html,daspkg.html,playground/index.html, andblog/template.html(regenerates all blog posts, news pages, changelist).site/files/news-counter.js, new): mirrorsblog-counter.js. Reuses the.forge-blog-chipCSS class (visually identical) — no new styles. Matches nav anchors bylink.hash === '#news', so the same script works whether the href is#news,index.html#news, or../index.html#news. Wired into the same 3 pages that already includeblog-counter.js:index.html,downloads.html,blog/template.html.daspkg.htmlandplayground/index.htmlshow the nav link but no chip, matching the priorblog-counter.jsscope.site/blog/build_blog.py): emitssite/files/news-meta.jsonalongside the existingnews.json/blog.json. Same shape asblog.json—newest_date,baseline_date,items: [{slug, date}]. Gitignored.site/_news/2026-05-27-0-6-3-is-just-around-the-corner-in-the.md— front-matter-only (no body page), surfaces in the landing news section and changelist.Test plan
python3 blog/build_blog.py --posts blog/_posts --news _news --template blog/template.html --out .— clean (34 posts, 31 news, all three JSON files emitted)python3 -m http.server+ browser:newslink visible beforedocswith1 NEWchipnewssmooth-scrolls to § 06; chip clears; localStorage updateddasImguitag / link)/blog/,/downloads.html,/daspkg.html,/playground/) —newslink present in nav, anchors back toindex.html#newslocalStorage.removeItem('daslang:news:lastSeen')→ chip returns on reload.dasfiles changed)🤖 Generated with Claude Code