From 19dce0665f6ab0c4cb97b555eb978bd3314f397d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20Tonh=C3=A4user?= Date: Thu, 30 Jul 2026 12:23:24 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20sichtbaren=20Eventinhalt=20pr=C3=BCfen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/eventfotografie.html | 2 +- scripts/check-seo.mjs | 22 +++++++++++++++++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/public/eventfotografie.html b/public/eventfotografie.html index bd91c00..1506cce 100644 --- a/public/eventfotografie.html +++ b/public/eventfotografie.html @@ -157,7 +157,7 @@
OMR x yes!wecancer
- Abiball — Eventfotografie + Abiball — Veranstaltungsreportage
Abiball
diff --git a/scripts/check-seo.mjs b/scripts/check-seo.mjs index 4626f8f..73d1ba3 100644 --- a/scripts/check-seo.mjs +++ b/scripts/check-seo.mjs @@ -15,14 +15,20 @@ function read(relativePath) { return readFileSync(path.join(ROOT, relativePath), 'utf8'); } -function visibleWordCount(html) { - const text = html +function visibleText(html) { + return html + .replace(//gi, ' ') .replace(//gi, ' ') .replace(//gi, ' ') + .replace(//gi, ' ') .replace(/<[^>]+>/g, ' ') .replace(/&[a-z0-9#]+;/gi, ' ') .replace(/\s+/g, ' ') .trim(); +} + +function visibleWordCount(html) { + const text = visibleText(html); return text ? text.split(' ').length : 0; } @@ -181,6 +187,15 @@ if (wants('sport')) { } if (wants('event')) { + check('Event-Nutzen und Referenzen können nicht nur in Metadaten stehen', () => { + const metadataOnly = pageHtml('eventfotografie.html') + .replace(//i, '
Ohne die geforderten Begriffe.
'); + const visible = visibleText(metadataOnly); + for (const term of ['Hamburg', 'deutschlandweit', 'PR', 'Social Media', 'YES!CON 2026', 'OMR x yes!wecancer']) { + assert.ok(!visible.includes(term), `${term} darf nicht aus Metadaten als sichtbarer Inhalt gelten`); + } + }); + check('Eventseite hat eindeutigen H1 und substanziellen Inhalt', () => { const html = pageHtml('eventfotografie.html'); assert.equal(count(html, / { const html = pageHtml('eventfotografie.html'); + const visible = visibleText(html); for (const term of ['Hamburg', 'deutschlandweit', 'PR', 'Social Media', 'YES!CON 2026', 'OMR x yes!wecancer']) { - assert.ok(html.includes(term), `${term} fehlt`); + assert.ok(visible.includes(term), `${term} fehlt im sichtbaren Inhalt`); } assert.ok(html.includes('"serviceType":"Eventfotografie"')); assert.ok(html.includes('"@type":"Country","name":"Deutschland"'));