/* Forge nav — "N NEW" blog chip. * * Data source: files/blog.json (built by site/blog/build_blog.py). * Storage: localStorage["daslang:blog:lastSeen"] = "YYYY-MM-DD". * * Semantics: * - First-time visitor (no key) → seeded from blog.json baseline_date, * which is the 2nd-newest post's date. * So count = 1 (just the newest). * - Visiting /blog/ (the index) → key set to newest_date; chip clears. * - count > 9 → render "9+ NEW". * - count === 0 → chip not rendered. */ (function () { 'use strict'; var STORAGE_KEY = 'daslang:blog:lastSeen'; function isBlogIndex() { var p = window.location.pathname; return p.endsWith('/blog/') || p.endsWith('/blog/index.html'); } function readLastSeen() { try { return window.localStorage.getItem(STORAGE_KEY); } catch (_) { return null; } } function writeLastSeen(date) { try { window.localStorage.setItem(STORAGE_KEY, date); } catch (_) { /* private mode / quota — silent */ } } function blogJsonUrl() { // Locate our own