From d3ae0a09d67362b8dd607ce9f123c39baa8e141b Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 19 Jul 2026 02:44:01 +0200 Subject: [PATCH 1/2] Move nav state to framework Remove README-injected nav script and repo-local nav-state asset/extra_javascript now that Process-PSModule centrally injects nav-state behavior during site build. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .github/docs/nav-state.js | 86 -------------------------------------- .github/zensical.toml | 1 - README.md | 87 --------------------------------------- 3 files changed, 174 deletions(-) delete mode 100644 .github/docs/nav-state.js diff --git a/.github/docs/nav-state.js b/.github/docs/nav-state.js deleted file mode 100644 index f78a3f1..0000000 --- a/.github/docs/nav-state.js +++ /dev/null @@ -1,86 +0,0 @@ -(() => { - const storageKey = "zensical-nav-state-v1"; - let lastSignature = ""; - - const getToggles = () => - Array.from(document.querySelectorAll("input.md-nav__toggle.md-toggle[id]")); - - const getPrimaryList = () => - document.querySelector("nav.md-nav--primary > ul.md-nav__list"); - - const applyDefaultTopLevelState = (toggles) => { - const primaryList = getPrimaryList(); - if (!primaryList) { - return; - } - - const topLevelToggles = Array.from( - primaryList.querySelectorAll( - ":scope > li > input.md-nav__toggle.md-toggle[id]" - ) - ); - const topLevelIds = new Set(topLevelToggles.map((toggle) => toggle.id)); - - for (const toggle of toggles) { - toggle.checked = topLevelIds.has(toggle.id); - } - }; - - const restoreState = (toggles) => { - const raw = localStorage.getItem(storageKey); - if (!raw) { - applyDefaultTopLevelState(toggles); - return; - } - - try { - const state = JSON.parse(raw); - for (const toggle of toggles) { - if (Object.prototype.hasOwnProperty.call(state, toggle.id)) { - toggle.checked = !!state[toggle.id]; - } - } - } catch { - applyDefaultTopLevelState(toggles); - } - }; - - const persistState = (toggles) => { - const state = {}; - for (const toggle of toggles) { - state[toggle.id] = !!toggle.checked; - } - localStorage.setItem(storageKey, JSON.stringify(state)); - }; - - const initialize = () => { - const toggles = getToggles(); - if (toggles.length === 0) { - return; - } - - const signature = toggles.map((toggle) => toggle.id).join("|"); - if (signature === lastSignature) { - return; - } - - lastSignature = signature; - restoreState(toggles); - for (const toggle of toggles) { - if (toggle.dataset.navStateBound === "true") { - continue; - } - - toggle.dataset.navStateBound = "true"; - toggle.addEventListener("change", () => persistState(getToggles())); - } - }; - - if (document.readyState === "loading") { - document.addEventListener("DOMContentLoaded", initialize, { once: true }); - } else { - initialize(); - } - - setInterval(initialize, 500); -})(); diff --git a/.github/zensical.toml b/.github/zensical.toml index bfeaa1d..e645d18 100644 --- a/.github/zensical.toml +++ b/.github/zensical.toml @@ -2,7 +2,6 @@ site_name = "-{{ REPO_NAME }}-" repo_name = "-{{ REPO_OWNER }}-/-{{ REPO_NAME }}-" repo_url = "https://github.com/-{{ REPO_OWNER }}-/-{{ REPO_NAME }}-" -extra_javascript = ["https://cdn.jsdelivr.net/gh/-{{ REPO_OWNER }}-/-{{ REPO_NAME }}-@main/.github/docs/nav-state.js"] [project.theme] language = "en" diff --git a/README.md b/README.md index 2a1a730..68db4f3 100644 --- a/README.md +++ b/README.md @@ -5,93 +5,6 @@ display: none !important; } - - {{ DESCRIPTION }} From 624a1cd878b75b9f9cf2ec871f7870cabebe261c Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 19 Jul 2026 02:44:57 +0200 Subject: [PATCH 2/2] Trigger publish for centralized nav Add a config comment-only change to trigger a fresh merged run so central Process-PSModule nav-state injection and README cleanup are published. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .github/zensical.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/zensical.toml b/.github/zensical.toml index e645d18..7a83281 100644 --- a/.github/zensical.toml +++ b/.github/zensical.toml @@ -1,3 +1,4 @@ +# Navigation behavior is injected centrally by Process-PSModule Build-Site. [project] site_name = "-{{ REPO_NAME }}-" repo_name = "-{{ REPO_OWNER }}-/-{{ REPO_NAME }}-"