Files
fristydev/app/layout.tsx
T

40 lines
1.2 KiB
TypeScript

import type { Metadata } from "next";
import { Cascadia_Mono } from "next/font/google";
import "./globals.css";
import { getDictionary } from "@/lib/i18n/get-dictionary";
import { getLocale } from "@/lib/i18n/get-locale";
import { SITE_URL } from "@/lib/site";
const cascadiaCode = Cascadia_Mono({
variable: "--font-cascadia",
subsets: ["latin"],
});
export async function generateMetadata(): Promise<Metadata> {
const locale = await getLocale();
const dict = getDictionary(locale);
return {
metadataBase: new URL(SITE_URL),
title: {
default: dict.meta.title,
template: "%s · fristy.dev",
},
description: dict.meta.description,
openGraph: {
title: dict.meta.title,
description: dict.meta.description,
url: "/",
type: "website",
},
};
}
export default async function RootLayout({ children }: LayoutProps<"/">) {
const locale = await getLocale();
return (
<html lang={locale} className={`${cascadiaCode.variable} h-full antialiased`}>
<body className="min-h-full flex flex-col">{children}</body>
</html>
);
}