fix: Nutzungsbedingungen unter bestehendem Slug veröffentlichen
This commit is contained in:
1 parent
69179beb6d
commit
14425315e3
33 files changed
+56
-51
No files matched your search
@@ -44,7 +44,7 @@ function personBusinessGraph() {
|
||||
function breadcrumbListGraph(p) {
|
||||
const segs = p.split('/').filter(Boolean);
|
||||
const labels = {
|
||||
portfolio: 'Portfolio', leistungen: 'Leistungen', sportfotografie: 'Sportfotografie', eventfotografie: 'Eventfotografie', 'über-mich': 'Über mich', kontakt: 'Kontakt', agb: 'AGB & Lizenzbedingungen', blog: 'Blog', archiv: 'Archiv',
|
||||
portfolio: 'Portfolio', leistungen: 'Leistungen', sportfotografie: 'Sportfotografie', eventfotografie: 'Eventfotografie', 'über-mich': 'Über mich', kontakt: 'Kontakt', nutzungsbedingungen: 'AGB & Lizenzbedingungen', blog: 'Blog', archiv: 'Archiv',
|
||||
'portfolio-fc-st-pauli': 'FC St. Pauli', 'portfolio-hamburger-sv': 'Hamburger SV', 'portfolio-frauen-bundesliga': 'Frauen-Bundesliga',
|
||||
'portfolio-hannover-96': 'Hannover 96', 'portfolio-sv-meppen': 'SV Meppen', 'portfolio-deutschland-u21': 'Deutschland U21',
|
||||
'portfolio-nfv-pokalfinale-2026': 'NFV-Pokalfinale 2026', 'portfolio-yes-con-2026': 'YES!CON 2026',
|
||||
|
||||
+20
-15
@@ -370,21 +370,24 @@ if (wants('agb')) {
|
||||
'15. Schlussbestimmungen'
|
||||
];
|
||||
|
||||
check('AGB-Seite und SEO-Konfiguration sind vorhanden', () => {
|
||||
assert.ok(existsSync(path.join(PUBLIC, 'agb.html')), 'public/agb.html fehlt');
|
||||
const page = loadConfig().PAGES['/agb'];
|
||||
assert.ok(page, 'SEO_CONFIG.PAGES[\'/agb\'] fehlt');
|
||||
check('Nutzungsbedingungen sind nur unter dem freigegebenen Slug vorhanden', () => {
|
||||
assert.ok(existsSync(path.join(PUBLIC, 'nutzungsbedingungen.html')), 'public/nutzungsbedingungen.html fehlt');
|
||||
assert.ok(!existsSync(path.join(PUBLIC, 'agb.html')), 'public/agb.html darf nicht bleiben');
|
||||
const pages = loadConfig().PAGES;
|
||||
const page = pages['/nutzungsbedingungen'];
|
||||
assert.ok(page, 'SEO_CONFIG.PAGES[\'/nutzungsbedingungen\'] fehlt');
|
||||
assert.equal(pages['/agb'], undefined, 'alte /agb-Konfiguration darf nicht bleiben');
|
||||
assert.equal(page.title, expectedTitle);
|
||||
assert.equal(page.desc, expectedDescription);
|
||||
assert.deepEqual(Array.from(page.jsonld), ['breadcrumb']);
|
||||
assert.ok(
|
||||
pageHtml('agb.html').includes('"name":"AGB & Lizenzbedingungen"'),
|
||||
pageHtml('nutzungsbedingungen.html').includes('"name":"AGB & Lizenzbedingungen"'),
|
||||
'gebackener Breadcrumb-Name ist nicht freigegeben'
|
||||
);
|
||||
});
|
||||
|
||||
check('AGB-Seite ist semantisch in 15 Abschnitte gegliedert', () => {
|
||||
const html = pageHtml('agb.html');
|
||||
const html = pageHtml('nutzungsbedingungen.html');
|
||||
assert.equal(count(html, /<h1\b/g), 1, 'H1-Anzahl');
|
||||
assert.equal(count(html, /<h2\b/g), 15, 'H2-Anzahl');
|
||||
assert.ok(html.includes('<h1 class="hero-title">AGB & Lizenzbedingungen</h1>'));
|
||||
@@ -397,7 +400,7 @@ if (wants('agb')) {
|
||||
});
|
||||
|
||||
check('AGB-Seite enthält die freigegebenen Vertragsdaten ohne interne Platzhalter', () => {
|
||||
const html = pageHtml('agb.html');
|
||||
const html = pageHtml('nutzungsbedingungen.html');
|
||||
const visible = visibleMainText(html);
|
||||
for (const text of [
|
||||
'Leon Tonhäuser | Sportfotografie',
|
||||
@@ -419,7 +422,7 @@ if (wants('agb')) {
|
||||
});
|
||||
|
||||
check('AGB-Seite bietet eine druckfreundliche Ausgabe', () => {
|
||||
const html = pageHtml('agb.html');
|
||||
const html = pageHtml('nutzungsbedingungen.html');
|
||||
const css = read('public/custom/site.css');
|
||||
assert.match(html, /<button\b[^>]*\btype="button"[^>]*\bonclick="window\.print\(\)"[^>]*>/);
|
||||
const printRules = css.match(/@media\s+print\s*\{([\s\S]*?)\n\}/);
|
||||
@@ -432,7 +435,7 @@ if (wants('agb')) {
|
||||
});
|
||||
|
||||
check('AGB-H1 bleibt mobil ohne Worttrennung lesbar', () => {
|
||||
const html = pageHtml('agb.html');
|
||||
const html = pageHtml('nutzungsbedingungen.html');
|
||||
const css = read('public/custom/site.css');
|
||||
assert.match(html, /<body\s+class="agb-seite">/);
|
||||
const mobileTitleRule = css.match(
|
||||
@@ -443,14 +446,15 @@ if (wants('agb')) {
|
||||
assert.match(mobileTitleRule[1], /overflow-wrap:\s*normal;/);
|
||||
});
|
||||
|
||||
check('jeder vorhandene Top-Level-Footer verlinkt die AGB genau einmal', () => {
|
||||
check('jeder vorhandene Top-Level-Footer verlinkt nur den neuen Slug', () => {
|
||||
const files = readdirSync(PUBLIC).filter((file) => file.endsWith('.html')).sort();
|
||||
let footerCount = 0;
|
||||
for (const file of files) {
|
||||
const footer = pageHtml(file).match(/<footer\b[\s\S]*?<\/footer>/i);
|
||||
if (!footer) continue;
|
||||
footerCount += 1;
|
||||
assert.equal(count(footer[0], /href="\.\/agb"/g), 1, `${file}: AGB-Link im Footer`);
|
||||
assert.equal(count(footer[0], /href="\.\/nutzungsbedingungen"/g), 1, `${file}: Nutzungsbedingungen-Link im Footer`);
|
||||
assert.equal(count(footer[0], /href="\.\/agb"/g), 0, `${file}: alter AGB-Link im Footer`);
|
||||
}
|
||||
assert.ok(footerCount >= 28, `nur ${footerCount} Footer geprüft`);
|
||||
});
|
||||
@@ -461,16 +465,17 @@ if (wants('agb')) {
|
||||
assert.ok(form, 'Kontaktformular fehlt');
|
||||
assert.match(
|
||||
form[0],
|
||||
/<button\b[^>]*type="submit"[\s\S]*?<p\b[^>]*class="kontakt-rechtshinweis"[^>]*>Für geschäftliche Anfragen gelten unsere <a href="\.\/agb">AGB & Lizenzbedingungen<\/a>\.<\/p>/
|
||||
/<button\b[^>]*type="submit"[\s\S]*?<p\b[^>]*class="kontakt-rechtshinweis"[^>]*>Für geschäftliche Anfragen gelten unsere <a href="\.\/nutzungsbedingungen">AGB & Lizenzbedingungen<\/a>\.<\/p>/
|
||||
);
|
||||
});
|
||||
|
||||
check('Sitemap enthält die AGB mit aktuellem Versionsdatum', () => {
|
||||
check('Sitemap enthält nur den neuen Slug mit aktuellem Versionsdatum', () => {
|
||||
const xml = read('public/sitemap.xml');
|
||||
assert.equal(count(xml, /<loc>https:\/\/leon-tonhaeuser\.de\/agb<\/loc>/g), 1);
|
||||
assert.equal(count(xml, /<loc>https:\/\/leon-tonhaeuser\.de\/nutzungsbedingungen<\/loc>/g), 1);
|
||||
assert.doesNotMatch(xml, /<loc>https:\/\/leon-tonhaeuser\.de\/agb<\/loc>/);
|
||||
assert.match(
|
||||
xml,
|
||||
/<loc>https:\/\/leon-tonhaeuser\.de\/agb<\/loc><lastmod>2026-08-11<\/lastmod><changefreq>yearly<\/changefreq><priority>0\.2<\/priority>/
|
||||
/<loc>https:\/\/leon-tonhaeuser\.de\/nutzungsbedingungen<\/loc><lastmod>2026-08-11<\/lastmod><changefreq>yearly<\/changefreq><priority>0\.2<\/priority>/
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user