diff --git a/app/[locale]/layout.tsx b/app/[locale]/layout.tsx index 2aedc84..1793b16 100644 --- a/app/[locale]/layout.tsx +++ b/app/[locale]/layout.tsx @@ -2,12 +2,30 @@ import type { Metadata } from "next"; import Script from "next/script"; import { Locale, getDictionary } from "@/lib/i18n"; +const BASE_URL = "https://soccer-2026.info"; + export async function generateMetadata({ params }: { params: Promise<{ locale: string }> }): Promise { const { locale } = await params; const dict = getDictionary(locale as Locale); return { + metadataBase: new URL(BASE_URL), title: dict.meta.title, description: dict.meta.description, + alternates: { + canonical: `${BASE_URL}/${locale}`, + languages: { + en: `${BASE_URL}/en`, + de: `${BASE_URL}/de`, + }, + }, + openGraph: { + title: dict.meta.title, + description: dict.meta.description, + url: `${BASE_URL}/${locale}`, + locale: locale === "en" ? "en_US" : "de_DE", + siteName: "WM 2026 Dashboard", + type: "website", + }, }; } diff --git a/app/robots.ts b/app/robots.ts new file mode 100644 index 0000000..f52e18f --- /dev/null +++ b/app/robots.ts @@ -0,0 +1,12 @@ +import type { MetadataRoute } from "next"; + +export default function robots(): MetadataRoute.Robots { + return { + rules: { + userAgent: "*", + allow: "/", + disallow: ["/api/"], + }, + sitemap: "https://soccer-2026.info/sitemap.xml", + }; +} diff --git a/app/sitemap.ts b/app/sitemap.ts new file mode 100644 index 0000000..eea4fec --- /dev/null +++ b/app/sitemap.ts @@ -0,0 +1,33 @@ +import type { MetadataRoute } from "next"; + +const BASE = "https://soccer-2026.info"; + +export default function sitemap(): MetadataRoute.Sitemap { + const now = new Date(); + return [ + { + url: `${BASE}/en`, + lastModified: now, + changeFrequency: "hourly", + priority: 1.0, + alternates: { + languages: { + en: `${BASE}/en`, + de: `${BASE}/de`, + }, + }, + }, + { + url: `${BASE}/de`, + lastModified: now, + changeFrequency: "hourly", + priority: 1.0, + alternates: { + languages: { + en: `${BASE}/en`, + de: `${BASE}/de`, + }, + }, + }, + ]; +}