import type { Metadata } from "next"; import Link from "next/link"; import { notFound } from "next/navigation"; import Nav from "@/components/nav"; import Footer from "@/components/footer"; 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, publishedTime: "2026-08-03T08:00:00+02:00", modifiedTime: "2026-08-03T08:00:00+02:00", }, }; } 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", "@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 }, }; return ( <>