i18n & SEO
How locale routing, canonical URLs, hreflang, and JSON-LD fit together.
The template ships locale-aware routing and SEO so content pages are correct for crawlers without per-page wiring.
Locale-addressed routes
The configured-locale list lives in gt.config.json. gt-next's public helpers
provide that list to routing, static generation, metadata, and the fumadocs
loader. The default locale is served unprefixed (/docs), other locales under a
prefix (/zh/docs).
Locale-neutral Dashboard
The Dashboard keeps one route family at /dash for every configured locale.
Its request locale comes from the user's GT preference, then the browser's
preferred languages, then the configured default. Changing locale refreshes the
translated interface without changing the pathname. Locale-prefixed Dashboard
paths such as /zh/dash are invalid rather than alternate URLs.
Dashboard routes inherit noindex, nofollow metadata and remain outside the
sitemap because they are the future signed-in product surface.
Adaptive hreflang
A content locale is a configured locale with a genuine
index.<locale>.mdx source file in that page's folder. Untranslated request
locales consolidate onto the default-locale canonical instead of advertising a
near-duplicate — so adding a translation automatically extends the hreflang
cluster, and removing one retracts it.
Metadata helpers
src/lib/metadata.ts builds the canonical URL, the hreflang languages map, and
the Open Graph / Twitter defaults. Each route's generateMetadata composes them;
the sitemap reuses the same helpers so every surface stays consistent.
Structured data
Blog posts emit BlogPosting + BreadcrumbList (and FAQPage when a post
declares faqs); author pages emit Person; the blog index emits ItemList.
View source on any content page to see the JSON-LD.