36 lines
1.4 KiB
TypeScript
36 lines
1.4 KiB
TypeScript
import type { Metadata } from "next";
|
|
import { headers } from "next/headers";
|
|
import "./globals.css";
|
|
|
|
export async function generateMetadata(): Promise<Metadata> {
|
|
const requestHeaders = await headers();
|
|
const host = requestHeaders.get("x-forwarded-host") ?? requestHeaders.get("host") ?? "localhost:3000";
|
|
const protocol = requestHeaders.get("x-forwarded-proto") ?? (host.startsWith("localhost") ? "http" : "https");
|
|
const origin = `${protocol}://${host}`;
|
|
|
|
return {
|
|
title: "OrbitFlow · React 后台模板",
|
|
description: "包含组件样式、内容列表、流程泳道和定时任务的纯前端 React 后台模板。",
|
|
icons: { icon: "/favicon.svg", shortcut: "/favicon.svg" },
|
|
openGraph: {
|
|
title: "OrbitFlow · React 后台模板",
|
|
description: "纯前端、JSON 数据驱动的现代后台模板。",
|
|
images: [{ url: new URL("/og.png", origin).toString(), width: 1200, height: 630, alt: "OrbitFlow 后台模板" }],
|
|
},
|
|
twitter: {
|
|
card: "summary_large_image",
|
|
title: "OrbitFlow · React 后台模板",
|
|
description: "组件、泳道、定时任务,一套可直接使用的纯前端后台模板。",
|
|
images: [new URL("/og.png", origin).toString()],
|
|
},
|
|
};
|
|
}
|
|
|
|
export default function RootLayout({ children }: Readonly<{ children: React.ReactNode }>) {
|
|
return (
|
|
<html lang="zh-CN">
|
|
<body>{children}</body>
|
|
</html>
|
|
);
|
|
}
|