import type { Metadata } from "next"; import Image from "next/image"; import Link from "next/link"; import { notFound } from "next/navigation"; import Nav from "@/components/nav"; import Footer from "@/components/footer"; import ContextualGuideLink from "@/components/contextual-guide-link"; import RelatedGuideArticles from "@/components/related-guide-articles"; import { getGuide, GUIDES } from "@/lib/guides"; import { TOOL_PAGES } from "@/lib/tool-pages"; const SITE_URL = "https://entscheidomat.com"; export function generateStaticParams() { return GUIDES.map(({ slug }) => ({ slug })); } export async function generateMetadata({ params }: PageProps<"/ratgeber/[slug]">): Promise { const { slug } = await params; const guide = getGuide(slug); if (!guide) return {}; return { title: guide.title, description: guide.description, alternates: { canonical: `/ratgeber/${guide.slug}` }, openGraph: { type: "article", locale: "de_DE", url: `${SITE_URL}/ratgeber/${guide.slug}`, title: guide.title, description: guide.description, images: [{ url: guide.image.socialSrc, alt: guide.image.alt, width: 1200, height: 630 }], publishedTime: "2026-08-03T08:00:00+02:00", modifiedTime: "2026-08-03T08:00:00+02:00", }, twitter: { card: "summary_large_image", title: guide.title, description: guide.description, images: [{ url: guide.image.socialSrc, alt: guide.image.alt }], }, }; } export default async function GuidePage({ params }: PageProps<"/ratgeber/[slug]">) { const { slug } = await params; const guide = getGuide(slug); if (!guide) notFound(); const url = `${SITE_URL}/ratgeber/${guide.slug}`; const relatedTools = guide.relatedTools .map((slug) => TOOL_PAGES.find((tool) => tool.slug === slug)) .filter((tool): tool is (typeof TOOL_PAGES)[number] => Boolean(tool)); const jsonLd = { "@context": "https://schema.org", "@graph": [ { "@type": "Article", headline: guide.title, description: guide.description, datePublished: "2026-08-03", dateModified: "2026-08-03", inLanguage: "de-DE", mainEntityOfPage: url, author: { "@type": "Person", name: "Timo Knuth" }, publisher: { "@type": "Organization", name: "Entscheidomat", url: SITE_URL, logo: { "@type": "ImageObject", url: `${SITE_URL}/icon.svg`, width: 512, height: 512 }, }, image: { "@type": "ImageObject", url: `${SITE_URL}${guide.image.src}`, width: 1536, height: 1024 }, }, { "@type": "BreadcrumbList", itemListElement: [ { "@type": "ListItem", position: 1, name: "Entscheidomat", item: SITE_URL }, { "@type": "ListItem", position: 2, name: "Ratgeber", item: `${SITE_URL}/ratgeber` }, { "@type": "ListItem", position: 3, name: guide.title, item: url }, ], }, ], }; return ( <>