/** * One-time migration: extract nav/footer from index.html, rewrite all HTML pages. */ import fs from "fs"; import path from "path"; import { fileURLToPath } from "url"; import crypto from "crypto"; const ROOT = path.join(path.dirname(fileURLToPath(import.meta.url)), ".."); const COMPONENTS = path.join(ROOT, "components"); const REPORT_PATH = path.join(ROOT, "docs", "layout-migration-report.md"); const SKIP_DIRS = new Set(["temp", "node_modules", "assets", "components", "scripts", "docs"]); const SKIP_FILES = new Set(["test.html"]); const NAV_PARTIAL_RE = /[\s\S]*?/i; const NAV_LEGACY_RE = /\s*