diff --git a/refs-html/background-remover.html b/refs-html/background-remover.html index 3c578aa..8b3675c 100644 --- a/refs-html/background-remover.html +++ b/refs-html/background-remover.html @@ -2232,5 +2232,19 @@ h1 { - + + + + \ No newline at end of file diff --git a/refs-html/demo.html b/refs-html/demo.html index 64c5d3e..80072d2 100644 --- a/refs-html/demo.html +++ b/refs-html/demo.html @@ -2590,5 +2590,19 @@ h1 { - + + + + \ No newline at end of file diff --git a/refs-html/gradient.html b/refs-html/gradient.html index 1ff30c0..b647f3c 100644 --- a/refs-html/gradient.html +++ b/refs-html/gradient.html @@ -2227,5 +2227,19 @@ opacity: 1; - + + + + \ No newline at end of file diff --git a/refs-html/index.html b/refs-html/index.html index 28aa2d4..37d55ae 100644 --- a/refs-html/index.html +++ b/refs-html/index.html @@ -2590,5 +2590,19 @@ h1 { - + + + + \ No newline at end of file diff --git a/refs-html/list-tools.html b/refs-html/list-tools.html index d8ba64a..1646614 100644 --- a/refs-html/list-tools.html +++ b/refs-html/list-tools.html @@ -2954,5 +2954,19 @@ h1 { - + + + + \ No newline at end of file diff --git a/scripts/extract-static.mjs b/scripts/extract-static.mjs index b22c638..aab5faa 100644 --- a/scripts/extract-static.mjs +++ b/scripts/extract-static.mjs @@ -7,6 +7,31 @@ import { join, dirname, basename } from 'node:path'; const root = process.argv[2]; const dest = process.argv[3]; +// --- inject a minimal theme toggle (extraction strips all +`; + +function injectThemeToggle(html) { + if (html.includes('__themeToggleInjected')) return html; + const tag = ''; + if (html.includes(tag)) return html.replace(tag, THEME_TOGGLE + '\n' + tag); + if (html.includes('')) return html.replace('', THEME_TOGGLE + '\n'); + return html + '\n' + THEME_TOGGLE; +} + // --- CSS: find the compiled chunk and pretty-print it --- const cssChunks = join(root, '..', '..', 'static', 'chunks'); const cssFile = readdirSync(cssChunks) @@ -110,6 +135,7 @@ for (const [src, out] of pages) { ); html = fmtHtml(html); + html = injectThemeToggle(html); const file = join(dest, out); mkdirSync(dirname(file), { recursive: true });