This repository has been archived on 2026-08-27. You can view files and clone it, but cannot push or open issues or pull requests.
Files
RECS-WEB-MODLE-REACT/app/layout.tsx
2026-08-27 20:15:24 +08:00

32 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: "WBBR · AI 前端样式模板工程",
description: "用于在项目内为 AI 定义布局、组件、交互和响应式规则的 React 前端样式模板工程。",
icons: { icon: "/favicon.svg", shortcut: "/favicon.svg" },
openGraph: {
title: "WBBR · AI 前端样式模板工程",
description: "通过可运行页面为项目内 AI 提供统一的前端视觉与交互基准。",
images: [{ url: new URL("/og.png", origin).toString(), width: 1200, height: 630, alt: "WBBR AI 前端样式模板工程" }],
},
twitter: {
card: "summary_large_image",
title: "WBBR · AI 前端样式模板工程",
description: "后台、内容与可视化页面样式基准,全部使用本地 JSON 演示。",
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>;
}