Files
gdm-Servo-model/app/layout.tsx
2026-08-11 15:27:26 +08:00

37 lines
1.4 KiB
TypeScript
Raw 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: "高徳乐商城536款产品资料支持产品参数搜索、AI舵机初选与样品申请。",
openGraph: {
title: "高徳乐 AI 舵机选型助手",
description: "536款商城产品完整目录。3分钟找到适合你的舵机AI初选工程师复核。",
images: [{ url: new URL("/og.png", metadataBase).toString(), width: 1200, height: 630 }],
type: "website",
},
twitter: {
card: "summary_large_image",
title: "高徳乐 AI 舵机选型助手",
description: "高徳乐商城产品资料与 AI 舵机选型助手。",
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>
);
}