54 lines
1.2 KiB
TypeScript
54 lines
1.2 KiB
TypeScript
import type { Metadata } from 'next';
|
|
import '../globals.css';
|
|
import { getTDK } from '../../lib/tdk';
|
|
|
|
export async function generateMetadata({
|
|
params,
|
|
}: {
|
|
params: { locale: string };
|
|
}): Promise<Metadata> {
|
|
const tdk = getTDK(params.locale, 'home');
|
|
|
|
return {
|
|
title: tdk.title,
|
|
description: tdk.description,
|
|
keywords: tdk.keywords,
|
|
openGraph: {
|
|
title: tdk.title,
|
|
description: tdk.description,
|
|
type: 'website',
|
|
locale: params.locale,
|
|
},
|
|
twitter: {
|
|
card: 'summary_large_image',
|
|
title: tdk.title,
|
|
description: tdk.description,
|
|
},
|
|
};
|
|
}
|
|
|
|
interface RootLayoutProps {
|
|
children: React.ReactNode;
|
|
params: { locale: string };
|
|
}
|
|
|
|
export async function generateStaticParams() {
|
|
return [
|
|
{ locale: 'zh-CN' },
|
|
{ locale: 'zh-TW' },
|
|
{ locale: 'en' },
|
|
{ locale: 'ko' },
|
|
{ locale: 'ja' },
|
|
];
|
|
}
|
|
|
|
export default function RootLayout({ children, params }: RootLayoutProps) {
|
|
return (
|
|
<html lang={params.locale} data-oid="_2v8est">
|
|
<body className="" data-oid=".3ow06e">
|
|
{children}
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|