- Add English translations to cv-data.ts with getCvData(lang) helper - Create app/[lang]/ routing with static generation for nl and en - Add language switcher in nav (NL / EN toggle) - Add middleware for Accept-Language auto-redirect on root path - Root layout reads x-lang header to set <html lang> correctly - All components accept lang prop and render translated content Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
39 lines
1.3 KiB
TypeScript
39 lines
1.3 KiB
TypeScript
import type { Metadata } from "next";
|
|
|
|
export async function generateStaticParams() {
|
|
return [{ lang: "nl" }, { lang: "en" }];
|
|
}
|
|
|
|
export async function generateMetadata({
|
|
params,
|
|
}: {
|
|
params: Promise<{ lang: string }>;
|
|
}): Promise<Metadata> {
|
|
const { lang } = await params;
|
|
const isEn = lang === "en";
|
|
return {
|
|
title: "Janpeter Visser — Software Engineer",
|
|
description: isEn
|
|
? "Personal website of Janpeter Visser. Allround software engineer with 30 years of experience in full-stack development, from C++ to Angular and .NET."
|
|
: "Persoonlijke website van Janpeter Visser. Allround software engineer met 30 jaar ervaring in full-stack development, van C++ tot Angular en .NET.",
|
|
metadataBase: new URL("https://jp-visser.nl"),
|
|
openGraph: {
|
|
title: "Janpeter Visser — Software Engineer",
|
|
description: isEn
|
|
? "Allround software engineer with 30 years of experience in full-stack development."
|
|
: "Allround software engineer met 30 jaar ervaring in full-stack development.",
|
|
url: `https://jp-visser.nl/${lang}`,
|
|
siteName: "Janpeter Visser",
|
|
locale: isEn ? "en_GB" : "nl_NL",
|
|
type: "website",
|
|
},
|
|
};
|
|
}
|
|
|
|
export default function LangLayout({
|
|
children,
|
|
}: {
|
|
children: React.ReactNode;
|
|
}) {
|
|
return <>{children}</>;
|
|
}
|