Files
gdm-Servo-model/app/layout.tsx
2026-08-14 15:38:24 +08:00

37 lines
1.4 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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 metadataBase = new URL(`${protocol}://${host}`);
return {
metadataBase,
title: "高徳乐 AI 舵机选型助手",
description: "高徳乐243款舵机配件共286个产品型号支持搜索筛选、AI舵机初选与样品申请。",
openGraph: {
title: "高徳乐 AI 舵机选型助手",
description: "243款舵机配件共286个型号。3分钟找到适合你的舵机AI初选工程师复核。",
images: [{ url: new URL("/og.png", metadataBase).toString(), width: 1200, height: 630 }],
type: "website",
},
twitter: {
card: "summary_large_image",
title: "高徳乐 AI 舵机选型助手",
description: "3分钟找到适合你的舵机。",
images: [new URL("/og.png", metadataBase).toString()],
},
};
}
export default function RootLayout({ children }: Readonly<{ children: React.ReactNode }>) {
return (
<html lang="zh-CN">
<body>{children}</body>
</html>
);
}