feat(docs): add comprehensive SEO optimization for static docs site
Add per-page metadata, Open Graph / Twitter tags, canonical URLs, hreflang, sitemap generation, robots.txt, and JSON-LD structured data for the bilingual (en/cn) documentation site.
This commit is contained in:
1 parent
bd78436ab1
commit
4b9f770534
10 files changed
+391
-7
No files matched your search
@@ -1,4 +1,6 @@
|
||||
import { LandingNav } from '@/components/landing/LandingNav';
|
||||
import { buildMetadata } from '@/lib/metadata';
|
||||
import type { Metadata } from 'next';
|
||||
|
||||
const channels = [
|
||||
{
|
||||
@@ -58,6 +60,23 @@ const i18n = {
|
||||
},
|
||||
};
|
||||
|
||||
export async function generateMetadata({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ lang: string }>;
|
||||
}): Promise<Metadata> {
|
||||
const { lang } = await params;
|
||||
const l = lang === 'cn' ? 'cn' : 'en';
|
||||
const t = i18n[l];
|
||||
|
||||
return buildMetadata({
|
||||
title: t.title,
|
||||
description: t.desc,
|
||||
path: `/${l}/community`,
|
||||
lang: l,
|
||||
});
|
||||
}
|
||||
|
||||
export default async function CommunityPage({ params }: { params: Promise<{ lang: string }> }) {
|
||||
const { lang } = await params;
|
||||
const l = lang === 'cn' ? 'cn' : 'en';
|
||||
|
||||
Reference in new issue
Block a user