diff --git a/app/[lang]/layout.tsx b/app/[lang]/layout.tsx new file mode 100644 index 0000000..a2a80c2 --- /dev/null +++ b/app/[lang]/layout.tsx @@ -0,0 +1,39 @@ +import type { Metadata } from "next"; + +export async function generateStaticParams() { + return [{ lang: "nl" }, { lang: "en" }]; +} + +export async function generateMetadata({ + params, +}: { + params: Promise<{ lang: string }>; +}): Promise { + 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}; +} diff --git a/app/[lang]/page.tsx b/app/[lang]/page.tsx new file mode 100644 index 0000000..b464742 --- /dev/null +++ b/app/[lang]/page.tsx @@ -0,0 +1,39 @@ +import { redirect } from "next/navigation"; +import type { Lang } from "@/lib/cv-data"; +import { Nav } from "@/components/nav"; +import { Hero } from "@/components/hero"; +import { MotivationSection } from "@/components/motivation"; +import { ExperienceSection } from "@/components/experience"; +import { SkillsSection } from "@/components/skills"; +import { AppsSection } from "@/components/apps"; +import { ContactSection } from "@/components/contact"; +import { Footer } from "@/components/footer"; + +const VALID_LANGS: Lang[] = ["nl", "en"]; + +export default async function LangPage({ + params, +}: { + params: Promise<{ lang: string }>; +}) { + const { lang } = await params; + + if (!VALID_LANGS.includes(lang as Lang)) { + redirect("/nl"); + } + + const currentLang = lang as Lang; + + return ( + <> +