fix: SEO-Bake idempotent halten

This commit is contained in:
Leon Tonhäuser committed 2026-07-30 11:55:47 +02:00
1 parent 1131ca5f81
commit 6dbf5c2fec
29 files changed
+42 -28

No files matched your search

+1 -1
View File
@@ -132,7 +132,7 @@ for (const f of readdirSync(PUB).filter((x) => x.endsWith('.html'))) {
html = html.replace('</title>', `</title>\n\t${descriptionTag}`);
}
}
const re = new RegExp(reEsc(BEGIN) + '[\\s\\S]*?' + reEsc(END) + '\\n?');
const re = new RegExp('[\\t ]*' + reEsc(BEGIN) + '[\\s\\S]*?' + reEsc(END) + '\\n?');
html = html.replace(re, '');
if (!html.includes('</head>')) { console.warn('kein </head> in', f); continue; }
html = html.replace('</head>', buildBlock(p) + '\n</head>');