- Split the config into a createConfig(target) factory plus a thin .cn wrapper, so the two deployments differ in one place. The .cn build points canonical, hreflang, og:url, sitemap and robots at that origin, and omits social links that are not reachable from mainland China. - Generate sitemap.xml and robots.txt per target. robots.txt is written at build time because one static file cannot carry the right origin for both domains. - Emit per-page canonical, hreflang and Open Graph tags. og:title and friends are left to the theme, which already emits them and does not de-duplicate against site-level head entries. - Redirect the retired /projects/ paths on Vercel, before the CN redirect so those visitors get a single hop.
38 lines
819 B
JSON
38 lines
819 B
JSON
{
|
|
"outputDirectory": "doc_build",
|
|
"redirects": [
|
|
{
|
|
"source": "/zh-hans/projects",
|
|
"destination": "/zh-hans/opensource-projects/",
|
|
"permanent": true
|
|
},
|
|
{
|
|
"source": "/zh-hans/projects/:path*",
|
|
"destination": "/zh-hans/opensource-projects/:path*",
|
|
"permanent": true
|
|
},
|
|
{
|
|
"source": "/projects",
|
|
"destination": "/opensource-projects/",
|
|
"permanent": true
|
|
},
|
|
{
|
|
"source": "/projects/:path*",
|
|
"destination": "/opensource-projects/:path*",
|
|
"permanent": true
|
|
},
|
|
{
|
|
"source": "/:path(.*)",
|
|
"has": [
|
|
{
|
|
"type": "header",
|
|
"key": "x-vercel-ip-country",
|
|
"value": "CN"
|
|
}
|
|
],
|
|
"destination": "https://onixbyte.cn/:path*",
|
|
"permanent": false
|
|
}
|
|
]
|
|
}
|