diff --git a/public/404.html b/public/404.html index e5eec34..8c9f11a 100644 --- a/public/404.html +++ b/public/404.html @@ -54,6 +54,19 @@ + + + + + + + + + + + + + diff --git a/public/blog.html b/public/blog.html index 2d696ed..4c03ae7 100644 --- a/public/blog.html +++ b/public/blog.html @@ -51,6 +51,19 @@ } a:hover { color: #fff; } + + + + + + + + + + + + + diff --git a/public/custom/seo-config.js b/public/custom/seo-config.js index de3f05c..9d1f546 100644 --- a/public/custom/seo-config.js +++ b/public/custom/seo-config.js @@ -6,7 +6,7 @@ SITE_URL: 'https://leon-tonhaeuser.de', SITE_NAME: 'Leon Tonhäuser | Sportfotograf', DEFAULT_DESCRIPTION: 'Sportfotograf für regionale Sportevents in Uelzen, Lüneburg und Umgebung. Rhine-Ruhr 2025, Frauen-Bundesliga und mehr im Portfolio.', - DEFAULT_OG_IMAGE: '/assets/images_TjoYzMAQxwv1bHENgPbqipmQUU.png', + DEFAULT_OG_IMAGE: '/assets/portfolio/sports/rhine-ruhr/beachvolleyball/galerie-02.jpg', BUSINESS: { name: 'Leon Tonhäuser Fotografie', type: 'ProfessionalService', @@ -54,6 +54,11 @@ desc: 'Spielberichte und Emotionen rund um den Hamburger SV. Sportfotografie von Leon Tonhäuser aus Uelzen — für Vereine und Sponsoren.', jsonld: ['breadcrumb', 'imageobject'] }, + '/portfolio-fc-st-pauli': { + title: 'FC St. Pauli | Leon Tonhäuser — Sportfotografie', + desc: 'Spielberichte und Emotionen rund um den FC St. Pauli. Sportfotografie von Leon Tonhäuser aus Uelzen — für Vereine und Sponsoren.', + jsonld: ['breadcrumb', 'imageobject'] + }, '/portfolio-rhine-ruhr-3x3': { title: 'Rhine-Ruhr 2025 – 3×3 Basketball | Leon Tonhäuser', desc: '3×3 Basketball vom Rhine-Ruhr 2025 Sports Event. Streetball, Dynamik, Teamgeist — fotografiert von Leon Tonhäuser.', @@ -79,6 +84,41 @@ desc: 'Spielberichte und Momente der SVG Lüneburg. Sportfotografie von Leon Tonhäuser — regional, authentisch, leidenschaftlich.', jsonld: ['breadcrumb', 'imageobject'] }, + '/portfolio-beach-soccer-cup': { + title: 'Beach Soccer Cup 2026 | Leon Tonhäuser — Sportfotografie', + desc: 'Beach Soccer Cup 2026 fotografiert von Leon Tonhäuser. Sand, Tempo und Tore — Sportfotografie für Turniere und Veranstalter.', + jsonld: ['breadcrumb', 'imageobject'] + }, + '/portfolio-deutschland-u21': { + title: 'Deutschland U21 | Leon Tonhäuser — Sportfotografie', + desc: 'Spielberichte und Emotionen der Deutschland U21. Sportfotografie von Leon Tonhäuser — authentisch, dynamisch, nah dran.', + jsonld: ['breadcrumb', 'imageobject'] + }, + '/portfolio-hannover-96': { + title: 'Hannover 96 | Leon Tonhäuser — Sportfotografie', + desc: 'Spielberichte und Momente rund um Hannover 96. Sportfotografie von Leon Tonhäuser aus Uelzen — für Vereine und Sponsoren.', + jsonld: ['breadcrumb', 'imageobject'] + }, + '/portfolio-nfv-pokalfinale-2026': { + title: 'NFV-Pokalfinale 2026 | Leon Tonhäuser — Sportfotografie', + desc: 'NFV-Pokalfinale 2026 fotografiert von Leon Tonhäuser. Pokal, Emotionen und Entscheidung — Sportfotografie für den NFV.', + jsonld: ['breadcrumb', 'imageobject'] + }, + '/portfolio-omr-yes-wecancer': { + title: 'OMR x yes!wecancer | Leon Tonhäuser — Eventfotografie', + desc: 'OMR x yes!wecancer — Eventfotografie von Leon Tonhäuser. Menschen, Begegnung und Botschaft in Bildern.', + jsonld: ['breadcrumb', 'imageobject'] + }, + '/portfolio-sv-meppen': { + title: 'SV Meppen | Leon Tonhäuser — Sportfotografie', + desc: 'Spielberichte und Momente des SV Meppen. Sportfotografie von Leon Tonhäuser — regional, authentisch, leidenschaftlich.', + jsonld: ['breadcrumb', 'imageobject'] + }, + '/portfolio-yes-con-2026': { + title: 'YES!CON 2026 | Leon Tonhäuser — Eventfotografie', + desc: 'YES!CON 2026 fotografiert von Leon Tonhäuser. Messe, Vorträge und Stimmung — Eventfotografie für Veranstalter.', + jsonld: ['breadcrumb', 'imageobject'] + }, '/leistungen': { title: 'Leistungen | Leon Tonhäuser — Sport- & Eventfotografie', desc: 'Eventfotografie, Sportfotografie und Reportagefotografie — Leistungen für Vereine, Veranstalter und Unternehmen in Uelzen, Lüneburg und Hamburg.', diff --git a/public/datenschutz.html b/public/datenschutz.html index 6fdedf6..e64081e 100644 --- a/public/datenschutz.html +++ b/public/datenschutz.html @@ -58,6 +58,19 @@ + + + + + + + + + + + + + diff --git a/public/impressum.html b/public/impressum.html index 9e7b7ba..a615f5e 100644 --- a/public/impressum.html +++ b/public/impressum.html @@ -58,6 +58,19 @@ + + + + + + + + + + + + + diff --git a/public/index.html b/public/index.html index 281b9f8..bc5fa1e 100644 --- a/public/index.html +++ b/public/index.html @@ -59,6 +59,20 @@ + + + + + + + + + + + + + + diff --git a/public/kontakt.html b/public/kontakt.html index e04bf28..2918151 100644 --- a/public/kontakt.html +++ b/public/kontakt.html @@ -58,6 +58,20 @@ + + + + + + + + + + + + + + diff --git a/public/leistungen.html b/public/leistungen.html index fb1023c..d454e39 100644 --- a/public/leistungen.html +++ b/public/leistungen.html @@ -58,6 +58,21 @@ + + + + + + + + + + + + + + + diff --git a/public/portfolio-abiball.html b/public/portfolio-abiball.html index e610bc9..669cfa3 100644 --- a/public/portfolio-abiball.html +++ b/public/portfolio-abiball.html @@ -58,6 +58,20 @@ + + + + + + + + + + + + + + diff --git a/public/portfolio-aufstiegsfeier.html b/public/portfolio-aufstiegsfeier.html index f859e42..0385b4b 100644 --- a/public/portfolio-aufstiegsfeier.html +++ b/public/portfolio-aufstiegsfeier.html @@ -58,6 +58,20 @@ + + + + + + + + + + + + + + diff --git a/public/portfolio-beach-soccer-cup.html b/public/portfolio-beach-soccer-cup.html index c7f5d16..cec17f0 100644 --- a/public/portfolio-beach-soccer-cup.html +++ b/public/portfolio-beach-soccer-cup.html @@ -58,6 +58,20 @@ + + + + + + + + + + + + + + diff --git a/public/portfolio-deutschland-u21.html b/public/portfolio-deutschland-u21.html index e367651..8e27b24 100644 --- a/public/portfolio-deutschland-u21.html +++ b/public/portfolio-deutschland-u21.html @@ -58,6 +58,20 @@ + + + + + + + + + + + + + + diff --git a/public/portfolio-fc-st-pauli.html b/public/portfolio-fc-st-pauli.html index d7bc87a..8ec62b4 100644 --- a/public/portfolio-fc-st-pauli.html +++ b/public/portfolio-fc-st-pauli.html @@ -58,6 +58,20 @@ + + + + + + + + + + + + + + diff --git a/public/portfolio-frauen-bundesliga.html b/public/portfolio-frauen-bundesliga.html index ac16d9a..1daecff 100644 --- a/public/portfolio-frauen-bundesliga.html +++ b/public/portfolio-frauen-bundesliga.html @@ -58,6 +58,20 @@ + + + + + + + + + + + + + + diff --git a/public/portfolio-hamburger-sv.html b/public/portfolio-hamburger-sv.html index 391794a..8f52298 100644 --- a/public/portfolio-hamburger-sv.html +++ b/public/portfolio-hamburger-sv.html @@ -58,6 +58,20 @@ + + + + + + + + + + + + + + diff --git a/public/portfolio-hannover-96.html b/public/portfolio-hannover-96.html index 0f79212..f726d46 100644 --- a/public/portfolio-hannover-96.html +++ b/public/portfolio-hannover-96.html @@ -58,6 +58,20 @@ + + + + + + + + + + + + + + diff --git a/public/portfolio-nfv-pokalfinale-2026.html b/public/portfolio-nfv-pokalfinale-2026.html index f93ea1b..b0ec4eb 100644 --- a/public/portfolio-nfv-pokalfinale-2026.html +++ b/public/portfolio-nfv-pokalfinale-2026.html @@ -58,6 +58,20 @@ + + + + + + + + + + + + + + diff --git a/public/portfolio-omr-yes-wecancer.html b/public/portfolio-omr-yes-wecancer.html index 0181248..ff8c450 100644 --- a/public/portfolio-omr-yes-wecancer.html +++ b/public/portfolio-omr-yes-wecancer.html @@ -58,6 +58,20 @@ + + + + + + + + + + + + + + diff --git a/public/portfolio-rhine-ruhr-3x3.html b/public/portfolio-rhine-ruhr-3x3.html index cb8854d..559e738 100644 --- a/public/portfolio-rhine-ruhr-3x3.html +++ b/public/portfolio-rhine-ruhr-3x3.html @@ -58,6 +58,20 @@ + + + + + + + + + + + + + + diff --git a/public/portfolio-rhine-ruhr-basketball.html b/public/portfolio-rhine-ruhr-basketball.html index 136c499..f47baeb 100644 --- a/public/portfolio-rhine-ruhr-basketball.html +++ b/public/portfolio-rhine-ruhr-basketball.html @@ -58,6 +58,20 @@ + + + + + + + + + + + + + + diff --git a/public/portfolio-rhine-ruhr-beachvolleyball.html b/public/portfolio-rhine-ruhr-beachvolleyball.html index cf17151..78c916d 100644 --- a/public/portfolio-rhine-ruhr-beachvolleyball.html +++ b/public/portfolio-rhine-ruhr-beachvolleyball.html @@ -58,6 +58,20 @@ + + + + + + + + + + + + + + diff --git a/public/portfolio-rhine-ruhr-sport.html b/public/portfolio-rhine-ruhr-sport.html index b609abe..a0bc4e6 100644 --- a/public/portfolio-rhine-ruhr-sport.html +++ b/public/portfolio-rhine-ruhr-sport.html @@ -58,6 +58,20 @@ + + + + + + + + + + + + + + diff --git a/public/portfolio-sv-meppen.html b/public/portfolio-sv-meppen.html index 39b5214..bde63ac 100644 --- a/public/portfolio-sv-meppen.html +++ b/public/portfolio-sv-meppen.html @@ -58,6 +58,20 @@ + + + + + + + + + + + + + + diff --git a/public/portfolio-svg-lueneburg.html b/public/portfolio-svg-lueneburg.html index 7a487cb..3d3db25 100644 --- a/public/portfolio-svg-lueneburg.html +++ b/public/portfolio-svg-lueneburg.html @@ -58,6 +58,20 @@ + + + + + + + + + + + + + + diff --git a/public/portfolio-yes-con-2026.html b/public/portfolio-yes-con-2026.html index e2b21ba..d5fa7d8 100644 --- a/public/portfolio-yes-con-2026.html +++ b/public/portfolio-yes-con-2026.html @@ -58,6 +58,20 @@ + + + + + + + + + + + + + + diff --git a/public/portfolio.html b/public/portfolio.html index 34051c2..277e0d0 100644 --- a/public/portfolio.html +++ b/public/portfolio.html @@ -59,6 +59,20 @@ + + + + + + + + + + + + + + diff --git a/public/über-mich.html b/public/über-mich.html index 6a3c7d1..b48f509 100644 --- a/public/über-mich.html +++ b/public/über-mich.html @@ -58,6 +58,20 @@ + + + + + + + + + + + + + + diff --git a/scripts/bake-seo.mjs b/scripts/bake-seo.mjs new file mode 100644 index 0000000..5ffd31d --- /dev/null +++ b/scripts/bake-seo.mjs @@ -0,0 +1,110 @@ +// Backt statische SEO-Tags (canonical, Open Graph, Twitter, JSON-LD) in den +// jeder Seite unter public/. Werte aus public/custom/seo-config.js, +// Logik äquivalent zu public/custom/seo.js. Idempotent (Marker-geschützter Block). +// +// Aufruf: node scripts/bake-seo.mjs +// Werte-Quelle bleibt seo-config.js; bei Config-Änderung neu ausführen. +import { readFileSync, writeFileSync, readdirSync } from 'node:fs'; +import vm from 'node:vm'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; + +const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..'); +const PUB = path.join(ROOT, 'public'); + +// seo-config.js laden (IIFE weist window.SEO_CONFIG zu) +const ctx = { window: {} }; +vm.createContext(ctx); +vm.runInContext(readFileSync(path.join(PUB, 'custom/seo-config.js'), 'utf8'), ctx); +const cfg = ctx.window.SEO_CONFIG; + +const SITE_URL = String(cfg.SITE_URL).replace(/\/$/, ''); +const SITE_NAME = cfg.SITE_NAME; +const OG_IMAGE = cfg.DEFAULT_OG_IMAGE ? SITE_URL + cfg.DEFAULT_OG_IMAGE : ''; +const biz = cfg.BUSINESS; + +const esc = (s) => String(s).replace(/&/g, '&').replace(/"/g, '"').replace(//g, '>'); +const jsonEsc = (s) => String(s).replace(/ s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); + +function personBusinessGraph() { + return { '@context': 'https://schema.org', '@graph': [ + { '@type': 'Person', name: biz.personName, jobTitle: biz.personJobTitle, url: SITE_URL, email: biz.email, telephone: biz.telephone }, + { '@type': 'ProfessionalService', name: biz.name, url: SITE_URL, telephone: biz.telephone, email: biz.email, + address: { '@type': 'PostalAddress', addressLocality: biz.addressLocality, addressRegion: biz.addressRegion, addressCountry: biz.addressCountry }, + areaServed: biz.areaServed.map((n) => ({ '@type': 'City', name: n })), priceRange: biz.priceRange } + ]}; +} + +function breadcrumbListGraph(p) { + const segs = p.split('/').filter(Boolean); + const labels = { + portfolio: 'Portfolio', leistungen: 'Leistungen', 'über-mich': 'Über mich', kontakt: 'Kontakt', 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', + 'portfolio-omr-yes-wecancer': 'OMR x yes!wecancer', 'portfolio-beach-soccer-cup': 'Beach Soccer Cup', + 'portfolio-aufstiegsfeier': 'Aufstiegsfeier', 'portfolio-abiball': 'Abiball', 'portfolio-svg-lueneburg': 'SVG Lüneburg', + 'portfolio-rhine-ruhr-3x3': 'Rhine-Ruhr 2025 – 3×3 Basketball', 'portfolio-rhine-ruhr-basketball': 'Rhine-Ruhr 2025 – Basketball', + 'portfolio-rhine-ruhr-beachvolleyball': 'Rhine-Ruhr 2025 – Beachvolleyball', 'portfolio-rhine-ruhr-sport': 'Rhine-Ruhr 2025 – Sportarten' + }; + const items = [{ '@type': 'ListItem', position: 1, name: 'Startseite', item: SITE_URL + '/' }]; + let acc = ''; + for (let i = 0; i < segs.length; i++) { + acc += '/' + segs[i]; + const label = labels[segs[i]] || segs[i].replace(/^portfolio-/, '').replace(/-/g, ' ').replace(/\b\w/g, (c) => c.toUpperCase()); + items.push({ '@type': 'ListItem', position: i + 2, name: label, item: SITE_URL + acc }); + } + return { '@context': 'https://schema.org', '@type': 'BreadcrumbList', itemListElement: items }; +} + +function serviceGraph() { + return { '@context': 'https://schema.org', '@type': 'Service', serviceType: biz.serviceType, + provider: { '@type': 'ProfessionalService', name: biz.name, url: SITE_URL }, + areaServed: biz.areaServed.map((n) => ({ '@type': 'City', name: n })), + hasOfferCatalog: { '@type': 'OfferCatalog', name: biz.serviceType + '-Leistungen', + itemListElement: biz.services.map((s) => ({ '@type': 'Offer', itemOffered: { '@type': 'Service', name: s } })) } }; +} + +const BEGIN = ''; +const END = ''; + +function buildBlock(p) { + const page = cfg.PAGES[p] || {}; + const title = page.title || cfg.SITE_NAME; + const desc = page.desc || cfg.DEFAULT_DESCRIPTION; + const canonical = SITE_URL + (p === '/' ? '/' : p); + const ogType = p === '/' ? 'website' : 'article'; + const L = [BEGIN, + ``, + ``, + ``, + ``, + ``, + ``]; + if (OG_IMAGE) L.push(``); + L.push(``, + ``, + ``); + if (OG_IMAGE) L.push(``); + const s = page.jsonld || []; + if (s.includes('person-business')) L.push(``); + if (s.includes('breadcrumb')) L.push(``); + if (s.includes('service')) L.push(``); + L.push(END); + return '\t' + L.join('\n\t'); +} + +let n = 0; +for (const f of readdirSync(PUB).filter((x) => x.endsWith('.html'))) { + const fp = path.join(PUB, f); + const p = f === 'index.html' ? '/' : '/' + f.replace(/\.html$/, ''); + let html = readFileSync(fp, 'utf8'); + const re = new RegExp(reEsc(BEGIN) + '[\\s\\S]*?' + reEsc(END) + '\\n?'); + html = html.replace(re, ''); + if (!html.includes('')) { console.warn('kein in', f); continue; } + html = html.replace('', buildBlock(p) + '\n'); + writeFileSync(fp, html); + n++; +} +console.log(`Gebacken: ${n} Seiten`); \ No newline at end of file