"use strict"; const fs = require("fs"); const path = require("path"); const websiteRoot = path.resolve(__dirname, "..", "website"); const releaseKey = "evidence-os-20260726-v26"; const socialImage = "https://aureonzorzatechnologies.pl/assets/images/brand/aureon-evidence-os-social-v4-20260721.png"; const socialAlt = "Aureon OS evidence workflow: Gather, Classify, Review, Export"; function walk(directory) { return fs.readdirSync(directory, { withFileTypes: true }).flatMap((entry) => { const target = path.join(directory, entry.name); return entry.isDirectory() ? walk(target) : [target]; }); } function attributeValue(source, expression) { const match = source.match(expression); return match ? match[1] : ""; } function addImageDimensions(source, imageName, width, height) { const escaped = imageName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); const expression = new RegExp(`]*\\bsrc="[^"]*${escaped}"[^>]*)>`, "gi"); return source.replace(expression, (tag, attributes) => { if (/\bwidth="/i.test(attributes) && /\bheight="/i.test(attributes)) return tag; return ``; }); } function canonicalNavigation(homeHref, activePage) { const links = [ ["projects", "Platform", "projects/"], ["diligence", "Diligence", "diligence/"], ["research", "Research", "research/"], ["funding", "Funding", "funding/"], ["publications", "Evidence", "publications/"], ["about", "Company", "about/"], ["contact", "Contact", "contact/"] ]; const markup = links.map(([id, label, route]) => { const active = id === activePage ? ' class="active" aria-current="page"' : ""; return `${label}`; }).join(""); return ``; } function socialMetadata(title, description, canonical) { return [ ' ', ' ', ' ', ` `, ` `, ` `, ` `, ' ', ' ', ` `, ' ', ` `, ` `, ` `, ` ` ].join("\n"); } let changedFiles = 0; const htmlFiles = walk(websiteRoot).filter((file) => file.toLowerCase().endsWith(".html")); for (const file of htmlFiles) { const original = fs.readFileSync(file, "utf8"); let source = original; const relativeDirectory = path.relative(websiteRoot, path.dirname(file)); const depth = relativeDirectory ? relativeDirectory.split(path.sep).length : 0; const rootHref = depth ? "../".repeat(depth) : "./"; // Meta refresh remains as the CSP-safe compatibility fallback. source = source.replace(/\s*