50 lines
1.2 KiB
TypeScript
50 lines
1.2 KiB
TypeScript
import type { Metadata, Viewport } from "next";
|
|
import { fontVariables } from "@/lib/fonts";
|
|
import { siteConfig } from "@/lib/site-config";
|
|
import "./globals.css";
|
|
|
|
/**
|
|
* 根布局。
|
|
*
|
|
* App Router 要求根布局渲染 <html> 与 <body>。由于所有页面都位于
|
|
* `app/[locale]/` 下,这里只负责最外层的文档骨架与全局字体变量,
|
|
* 具体语言、Provider 与导航壳由 `app/[locale]/layout.tsx` 承担。
|
|
*/
|
|
|
|
export const metadata: Metadata = {
|
|
metadataBase: new URL(siteConfig.url),
|
|
title: {
|
|
default: siteConfig.name,
|
|
template: `%s · ${siteConfig.name}`,
|
|
},
|
|
description: siteConfig.description,
|
|
applicationName: siteConfig.name,
|
|
authors: [{ name: siteConfig.author.name }],
|
|
creator: siteConfig.author.name,
|
|
formatDetection: {
|
|
email: false,
|
|
address: false,
|
|
telephone: false,
|
|
},
|
|
};
|
|
|
|
export const viewport: Viewport = {
|
|
width: "device-width",
|
|
initialScale: 1,
|
|
themeColor: "#ffffff",
|
|
};
|
|
|
|
export default function RootLayout({
|
|
children,
|
|
}: {
|
|
children: React.ReactNode;
|
|
}) {
|
|
return (
|
|
<html lang="zh-CN" className={fontVariables} suppressHydrationWarning>
|
|
<body className="min-h-dvh bg-canvas text-ink antialiased">
|
|
{children}
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|