import type { Metadata } from "next";
import type { Locale } from "@/i18n/routes";
import { site } from "@/content/site";

export function buildMetadata(locale: Locale, title: string, description: string): Metadata {
  const path = locale === "de" ? "" : "/en";
  const url = `${site.url}${path}`;
  return {
    title,
    description,
    openGraph: {
      title,
      description,
      url,
      siteName: "eldov.win",
      type: "website",
      locale: locale === "de" ? "de_DE" : "en_US",
    },
    twitter: {
      card: "summary",
      title,
      description,
    },
    alternates: {
      canonical: url,
      languages: {
        de: `${site.url}/`,
        en: `${site.url}/en`,
      },
    },
  };
}
