feat(seo): add sitemap, canonical metadata and legacy redirects

- 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.
This commit is contained in:
zihluwang committed 2026-09-25 14:48:49 +08:00
1 parent 638c71da44
commit 3f78e45899
3 files changed
+237 -36

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
/**
* Build configuration for `onixbyte.cn`.
*
* Thin wrapper over the shared factory — see `rspress.config.ts` for what the
* `cn` target changes. Invoke it with `pnpm build:cn`, which passes this file
* via `rspress build --config`.
*/
import { createConfig } from "./rspress.config"
export default createConfig("cn")