Skip to content

site: news nav link with "N NEW" chip + dasImgui announcement - #2907

Merged
borisbat merged 1 commit into
masterfrom
site/news-link
May 28, 2026
Merged

site: news nav link with "N NEW" chip + dasImgui announcement#2907
borisbat merged 1 commit into
masterfrom
site/news-link

Conversation

@borisbat

Copy link
Copy Markdown
Collaborator

Summary

  • New news link in the top nav (before docs) on every hand-authored page — anchor-jumps to § 06 "Recent activity" on the landing.
  • "N NEW" chip on the nav link, identical to the existing blog chip — driven by files/news-meta.json and a new files/news-counter.js. Marks seen on landing-with-#news-hash OR on click of the nav link; localStorage key daslang:news:lastSeen.
  • New _news entry: "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

  • Anchor + nav (5 nav copies): id="news" added to § 06 of site/index.html. <a href=".../index.html#news">news</a> inserted before docs in index.html, downloads.html, daspkg.html, playground/index.html, and blog/template.html (regenerates all blog posts, news pages, changelist).
  • Counter script (site/files/news-counter.js, new): mirrors blog-counter.js. Reuses the .forge-blog-chip CSS class (visually identical) — no new styles. Matches nav anchors by link.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 include blog-counter.js: index.html, downloads.html, blog/template.html. daspkg.html and playground/index.html show the nav link but no chip, matching the prior blog-counter.js scope.
  • Builder (site/blog/build_blog.py): emits site/files/news-meta.json alongside the existing news.json / blog.json. Same shape as blog.jsonnewest_date, baseline_date, items: [{slug, date}]. Gitignored.
  • News entry: 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:
    • Landing nav: news link visible before docs with 1 NEW chip
    • Clicking news smooth-scrolls to § 06; chip clears; localStorage updated
    • § 06 first row shows the dasImgui entry (date / dasImgui tag / link)
    • Sub-pages (/blog/, /downloads.html, /daspkg.html, /playground/) — news link present in nav, anchors back to index.html#news
    • Reset via localStorage.removeItem('daslang:news:lastSeen') → chip returns on reload
  • Pre-push hook: formatter verified, lint skipped (no .das files changed)

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings May 28, 2026 00:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 news nav links across hand-authored pages + anchored landing section via id="news".
  • Introduced site/files/news-counter.js and wired it into pages that already load the blog chip logic.
  • Extended site/blog/build_blog.py to emit files/news-meta.json, and added a new _news announcement 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.

Comment thread site/files/news-counter.js
Comment thread site/blog/build_blog.py Outdated
@@ -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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 23ed407build_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.

Comment thread site/blog/build_blog.py Outdated
- 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>
@borisbat
borisbat merged commit 2e17a70 into master May 28, 2026
31 checks passed
@borisbat
borisbat deleted the site/news-link branch May 30, 2026 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants