spb/wp-spboucher-ai
Public
1import type { Metadata, Viewport } from "next";2import "./globals.css";3import { APP_URL, SITE_NAME, SITE_SECONDARY } from "@/lib/env";4import { getLocale } from "@/lib/i18n/server";56export const metadata: Metadata = {7 metadataBase: new URL(APP_URL),8 title: { default: `${SITE_NAME} — ${SITE_SECONDARY}`, template: `%s · ${SITE_NAME}` },9 description: "An open collection of research working papers in finance, economics, artificial intelligence, real estate, and quantitative science by Simon-Pierre Boucher (Université du Québec en Outaouais).",10 applicationName: SITE_NAME,11 openGraph: { type: "website", siteName: SITE_NAME, locale: "en_CA" },12 robots: { index: true, follow: true },13};14export const viewport: Viewport = { themeColor: [{ media: "(prefers-color-scheme: light)", color: "#faf8f4" }, { media: "(prefers-color-scheme: dark)", color: "#15161a" }], width: "device-width", initialScale: 1 };15const themeScript = `(function(){try{var m=localStorage.getItem('theme');var d=m==='dark'||((!m||m==='system')&&matchMedia('(prefers-color-scheme: dark)').matches);if(d)document.documentElement.classList.add('dark');}catch(e){}})();`;1617export default async function RootLayout({ children }: { children: React.ReactNode }) {18 const locale = await getLocale();19 return (20 <html lang={locale} suppressHydrationWarning>21 <head><script dangerouslySetInnerHTML={{ __html: themeScript }} /></head>22 <body className="min-h-dvh flex flex-col">{children}</body>23 </html>24 );25}26