import type { Metadata } from "next"; import { cookies } from "next/headers"; import "./globals.css"; import Header from "@/components/Header"; import Footer from "@/components/Footer"; import Toaster from "@/components/Toaster"; export const metadata: Metadata = { title: { default: "姜十三论坛 · J13 FORUM", template: "%s · 姜十三论坛", }, description: "姜十三论坛 - 技术分享与讨论社区", openGraph: { title: "姜十三论坛 · J13 FORUM", description: "姜十三论坛 - 技术分享与讨论社区", type: "website", }, }; export default async function RootLayout({ children, }: { children: React.ReactNode; }) { const cookieStore = await cookies(); // 浅色优先的设计系统,仅在显式选择暗色时挂 .dark const theme = cookieStore.get("j13-theme")?.value === "dark" ? "dark" : "light"; return ( 跳到主要内容
{children}