diff --git a/app/[locale]/layout.tsx b/app/[locale]/layout.tsx index 86413e3..a2fc382 100644 --- a/app/[locale]/layout.tsx +++ b/app/[locale]/layout.tsx @@ -4,8 +4,9 @@ import "../globals.css"; import Navbar from "@/components/Navbar"; import Footer from "@/components/Footer"; import {NextIntlClientProvider} from 'next-intl'; -import {getMessages} from 'next-intl/server'; +import {getMessages, getTranslations} from 'next-intl/server'; import {notFound} from 'next/navigation'; +import {routing} from '@/i18n/routing'; const playfairDisplay = Playfair_Display({ variable: "--font-serif", @@ -20,10 +21,49 @@ const notoSerifSC = Noto_Serif_SC({ weight: ["300", "400", "500", "700"], }); -export const metadata: Metadata = { - title: "南京市肥鹅信息技术有限公司 | Nanjing Feie Information Technology", - description: "南京市肥鹅信息技术有限公司致力于为企业提供卓越的数字化解决方案,以创新技术驱动商业价值。", -}; +export async function generateMetadata({ + params +}: { + params: Promise<{locale: string}>; +}): Promise { + const { locale } = await params; + const t = await getTranslations({locale, namespace: 'Metadata'}); + const baseUrl = 'https://feietech.com'; // 请替换为您的实际域名 + + return { + title: t('title'), + description: t('description'), + alternates: { + canonical: `${baseUrl}/${locale}`, + languages: { + 'en': `${baseUrl}/en`, + 'zh': `${baseUrl}/zh`, + 'ja': `${baseUrl}/ja`, + }, + }, + openGraph: { + title: t('title'), + description: t('description'), + url: `${baseUrl}/${locale}`, + siteName: 'Nanjing Feie Information Technology', + locale: locale, + type: 'website', + images: [ + { + url: `${baseUrl}/icon.jpg`, + width: 1184, + height: 1184, + alt: 'Nanjing Feie Information Technology Logo', + }, + ], + }, + icons: { + icon: '/icon.jpg', + shortcut: '/icon.jpg', + apple: '/icon.jpg', + }, + }; +} export default async function LocaleLayout({ children, @@ -38,12 +78,32 @@ export default async function LocaleLayout({ } const messages = await getMessages(); + const baseUrl = 'https://feietech.com'; // 请替换为您的实际域名 + + const jsonLd = { + '@context': 'https://schema.org', + '@type': 'Organization', + name: 'Nanjing Feie Information Technology Co., Ltd.', + url: baseUrl, + logo: `${baseUrl}/assets/logo.png`, + contactPoint: { + '@type': 'ContactPoint', + telephone: '+86-198-4456-1014', + contactType: 'customer service', + areaServed: ['CN', 'US', 'JP'], + availableLanguage: ['Chinese', 'English', 'Japanese'] + } + }; return ( +