diff --git a/app/components/jsonld.php b/app/components/jsonld.php index d98c88d..278b027 100644 --- a/app/components/jsonld.php +++ b/app/components/jsonld.php @@ -3,13 +3,19 @@ declare(strict_types=1); /** - * SportsClub-Schema aus data/club.json — auf jeder Seite identisch (NAP-Konsistenz für SEO/GEO). + * JSON-LD als ein @graph. Der SportsClub-Knoten (aus data/club.json) ist auf jeder + * Seite identisch (NAP-Konsistenz für SEO/GEO) und hat eine feste @id, auf die + * seitenspezifische Knoten verweisen. + * Props: + * $extra array — zusätzliche Graph-Knoten der Seite (z. B. SportsTeam, FAQPage, + * BreadcrumbList), gebaut via team_schema()/page_schema(). */ $club = json_load('club'); +$clubId = abs_url() . '#club'; -$schema = [ - '@context' => 'https://schema.org', +$clubNode = [ '@type' => 'SportsClub', + '@id' => $clubId, 'name' => $club['name'], 'alternateName' => $club['legal_name'], 'foundingDate' => $club['founded'], @@ -27,5 +33,10 @@ $schema = [ ], 'sameAs' => array_values(array_filter($club['social'])), ]; + +$graph = [ + '@context' => 'https://schema.org', + '@graph' => array_merge([$clubNode], $extra ?? []), +]; ?> - + diff --git a/app/components/meta.php b/app/components/meta.php index 56151cb..2312df2 100644 --- a/app/components/meta.php +++ b/app/components/meta.php @@ -16,7 +16,7 @@ if (empty($meta['title_absolute'])) { $description = $meta['description'] ?? $club['description']; $canonical = abs_url($current === '404' ? '' : $current); $ogImage = rtrim((string) config('base_url'), '/') . '/assets/' . ltrim($meta['og_image'] ?? 'img/og-default.jpg', '/'); -$scripts = array_merge(['nav.js'], $meta['scripts'] ?? []); +$scripts = array_merge(['nav.js', 'back-to-top.js'], $meta['scripts'] ?? []); ?> @@ -49,4 +49,4 @@ $scripts = array_merge(['nav.js'], $meta['scripts'] ?? []); - + $meta['schema'] ?? []]); ?> diff --git a/app/layout.php b/app/layout.php index ee6054c..8006442 100644 --- a/app/layout.php +++ b/app/layout.php @@ -14,9 +14,12 @@ declare(strict_types=1);
Zum Inhalt springen $current]); ?> -