Files
gdm-Servo-model/app/layout.tsx
2026-08-10 11:48:07 +08:00

37 lines
1.3 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: "3分钟获得高徳乐舵机候选型号、匹配理由与样品申请方案。",
openGraph: {
title: "高徳乐 AI 舵机选型助手",
description: "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>
);
}