feat: Landingpage für regionale Sportfotografie
This commit is contained in:
1 parent
5eed960772
commit
7bf2ff19d8
2 files changed
+328
No files matched your search
@@ -15,6 +15,21 @@ function read(relativePath) {
|
||||
return readFileSync(path.join(ROOT, relativePath), 'utf8');
|
||||
}
|
||||
|
||||
function visibleWordCount(html) {
|
||||
const text = html
|
||||
.replace(/<script[\s\S]*?<\/script>/gi, ' ')
|
||||
.replace(/<style[\s\S]*?<\/style>/gi, ' ')
|
||||
.replace(/<[^>]+>/g, ' ')
|
||||
.replace(/&[a-z0-9#]+;/gi, ' ')
|
||||
.replace(/\s+/g, ' ')
|
||||
.trim();
|
||||
return text ? text.split(' ').length : 0;
|
||||
}
|
||||
|
||||
function pageHtml(file) {
|
||||
return read(`public/${file}`);
|
||||
}
|
||||
|
||||
function loadConfig() {
|
||||
const context = { window: {} };
|
||||
vm.createContext(context);
|
||||
@@ -129,6 +144,42 @@ if (wants('core')) {
|
||||
});
|
||||
}
|
||||
|
||||
if (wants('sport')) {
|
||||
check('Sportseite hat eindeutigen H1 und Canonical', () => {
|
||||
const html = pageHtml('sportfotografie.html');
|
||||
assert.equal(count(html, /<h1\b/g), 1);
|
||||
assert.ok(html.includes('<h1 class="hero-title">Sportfotograf für Hamburg und Norddeutschland</h1>'));
|
||||
assert.ok(html.includes('<link rel="canonical" href="https://leon-tonhaeuser.de/sportfotografie">'));
|
||||
});
|
||||
|
||||
check('Sportseite besitzt substanziellen Inhalt', () => {
|
||||
const words = visibleWordCount(pageHtml('sportfotografie.html'));
|
||||
assert.ok(words >= 500 && words <= 800, `Wortzahl ${words} liegt außerhalb 500–800`);
|
||||
});
|
||||
|
||||
check('Sportseite belegt Regionen mit vorhandenen Referenzen', () => {
|
||||
const html = pageHtml('sportfotografie.html');
|
||||
for (const href of [
|
||||
'./portfolio-hamburger-sv',
|
||||
'./portfolio-fc-st-pauli',
|
||||
'./portfolio-hannover-96',
|
||||
'./portfolio-svg-lueneburg',
|
||||
'./portfolio-nfv-pokalfinale-2026'
|
||||
]) {
|
||||
assert.ok(html.includes(`href="${href}"`), `${href} fehlt`);
|
||||
}
|
||||
for (const city of ['Hamburg', 'Hannover', 'Wolfsburg', 'Uelzen', 'Celle', 'Lüneburg']) {
|
||||
assert.ok(html.includes(city), `${city} fehlt`);
|
||||
}
|
||||
});
|
||||
|
||||
check('Sportseite hat Service-Schema und Kontakt-CTA', () => {
|
||||
const html = pageHtml('sportfotografie.html');
|
||||
assert.ok(html.includes('"serviceType":"Sportfotografie"'));
|
||||
assert.ok(html.includes('href="./kontakt"'));
|
||||
});
|
||||
}
|
||||
|
||||
if (failures.length) {
|
||||
console.error(`\n${failures.length} Prüfung(en) fehlgeschlagen.`);
|
||||
process.exit(1);
|
||||
|
||||
Reference in new issue
Block a user