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

+14
View File
@@ -1,4 +1,5 @@
import assert from 'node:assert/strict';
import { execFileSync } from 'node:child_process';
import { existsSync, readFileSync, readdirSync } from 'node:fs';
import path from 'node:path';
import vm from 'node:vm';
@@ -43,6 +44,13 @@ function check(name, fn) {
}
}
function bakeSeo() {
execFileSync(process.execPath, ['scripts/bake-seo.mjs'], {
cwd: ROOT,
stdio: 'pipe'
});
}
if (wants('core')) {
const config = loadConfig();
const cities = ['Hamburg', 'Hannover', 'Wolfsburg', 'Uelzen', 'Celle', 'Lüneburg'];
@@ -87,6 +95,12 @@ if (wants('core')) {
assert.ok(html.includes('"serviceType":"Eventfotografie"'));
assert.ok(html.includes('"@type":"Country","name":"Deutschland"'));
});
check('erneutes SEO-Backen verändert den Event-Head nicht', () => {
const before = read('public/eventfotografie.html');
bakeSeo();
assert.equal(read('public/eventfotografie.html'), before);
});
}
if (failures.length) {