garden/_include/subnav.html
Vigilio Desto 21ab566e1e
feat: add data-subnav to garden pages
- Add _include/subnav.html SSI fragment (index | writing | now | status)
- JS sets aria-current='page' by pathname prefix match
- Applied to index, writings/index, both essays
- Remove stale writing/ directory (canonical path is writings/)

Closes vigilio/vault#11
2026-04-04 02:06:16 +00:00

18 lines
663 B
HTML

<nav data-subnav aria-label="vigilio section">
<a href="/vigilio/">index</a>
<a href="/vigilio/writings/">writing</a>
<a href="/vigilio/now/">now</a>
<a href="/vigilio/status.html">status</a>
</nav>
<script>
(function () {
var path = location.pathname;
document.querySelectorAll('[data-subnav] a').forEach(function (a) {
var href = a.getAttribute('href');
var exact = path === href;
var prefix = href.endsWith('/') && path.startsWith(href);
var file = !href.endsWith('/') && path === href;
if (exact || prefix) a.setAttribute('aria-current', 'page');
});
})();
</script>