34 lines
794 B
TypeScript
34 lines
794 B
TypeScript
import type { Metadata } from "next";
|
|
import "./globals.css";
|
|
import AppShell from "@/components/AppShell";
|
|
|
|
export const metadata: Metadata = {
|
|
title: "写作后台",
|
|
description: "Blog admin for Hugo",
|
|
};
|
|
|
|
export default function RootLayout({
|
|
children,
|
|
}: Readonly<{
|
|
children: React.ReactNode;
|
|
}>) {
|
|
const themeScript = `
|
|
try {
|
|
if (localStorage.getItem("write-theme") === "dark") {
|
|
document.documentElement.dataset.theme = "dark";
|
|
}
|
|
} catch {}
|
|
`;
|
|
|
|
return (
|
|
<html lang="zh-CN" className="h-full" suppressHydrationWarning>
|
|
<head>
|
|
<script dangerouslySetInnerHTML={{ __html: themeScript }} />
|
|
</head>
|
|
<body className="h-full md:flex bg-bg text-text">
|
|
<AppShell>{children}</AppShell>
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|