// app/services/[slug]/page.tsx import type { Metadata } from "next"; import Link from "next/link"; import { notFound } from "next/navigation"; import JsonLd from "@/components/JsonLd"; import CtaPanel from "@/components/CtaPanel"; import { ServiceBullets } from "@/components/ServiceBullets"; import { getAllServices, getServiceBySlug } from "@/lib/services"; import { site } from "@/lib/site"; // assumes lib/site.ts exports { site: { url, name, ... } } export const revalidate = 86400; type Params = { slug: string }; export async function generateStaticParams() { return getAllServices().map((s) => ({ slug: s.slug })); } export async function generateMetadata({ params }: { params: Params }): Promise { const svc = getServiceBySlug(params.slug); if (!svc) return {}; return { title: svc.metaTitle, description: svc.metaDescription, alternates: { canonical: `/services/${svc.slug}` }, openGraph: { title: svc.metaTitle, description: svc.metaDescription, url: `${site.url}/services/${svc.slug}`, type: "article", images: [{ url: "/og.png", width: 1200, height: 630, alt: "Van Hunen IT" }], }, twitter: { card: "summary_large_image", title: svc.metaTitle, description: svc.metaDescription, images: ["/og.png"], }, }; } export default function ServicePage({ params }: { params: Params }) { const svc = getServiceBySlug(params.slug); if (!svc) notFound(); const breadcrumbLd = { "@context": "https://schema.org", "@type": "BreadcrumbList", "itemListElement": [ { "@type": "ListItem", position: 1, name: "Services", item: `${site.url}/services` }, { "@type": "ListItem", position: 2, name: svc.title, item: `${site.url}/services/${svc.slug}` }, ], }; const svcLd = { "@context": "https://schema.org", "@type": "Service", name: svc.title, description: svc.metaDescription || svc.outcome, provider: { "@type": "Organization", name: site.name, url: site.url, logo: `${site.url}/og.png` }, areaServed: "EU", offers: { "@type": "Offer", price: svc.price.replace(/[^\d]/g, "") || "0", priceCurrency: "EUR", availability: "https://schema.org/InStock" }, }; const related = (svc.relatedSlugs || []) .map((slug) => getAllServices().find((s) => s.slug === slug)) .filter(Boolean) as NonNullable>[]; return (

← Services

{svc.title}

{svc.outcome}

Who it’s for

    {svc.who.map((w, i) =>
  • {w}
  • )}
{svc.outcomes && }

Timeline

{svc.timeline}

Price

{svc.price}

{svc.faq?.length ? (

FAQ

{svc.faq.map((f, i) => (
{f.q}

{f.a}

))}
) : null} {related.length ? (
    {related.map((r) => (
  • {r.title}
  • ))}
) : null}
); }