4.6 KiB
GitHub Pages Language And GEO Workflow
Language: English | 简体中文
This workflow records the current public documentation-site gate for website/. It is intentionally separate from runtime plugin i18n and from Slidev export acceptance.
Current Contract
The website publishes one complete language surface and one partial language surface:
- English is the canonical complete documentation surface under
https://jacobinwwey.github.io/obsidian-NotEMD/docs/.... - Simplified Chinese currently publishes the homepage and FAQ only.
- Untranslated zh-CN fallback docs may still be generated by Docusaurus, but they must be fenced with
noindex,followand excluded from the zh-CN sitemap. - zh-CN homepage entry points for untranslated docs must route to canonical English URLs, not to
/zh-CN/docs/...fallback pages. llms.txtmust describe the same language boundary so answer engines do not infer full multilingual coverage.
Implemented Gate
The blocking gate is:
cd website
npm run build
npm run audit:build
npm run audit:build executes website/scripts/audit-build.cjs. The script checks the built output, not just source files:
- root pages exist:
build/index.htmlandbuild/zh-CN/index.html; - root pages have the expected
lang, canonical URL, and WebPage JSON-LD URL; - zh-CN homepage links untranslated critical docs to canonical English URLs;
- zh-CN homepage keeps FAQ on
/zh-CN/docs/faq; - untranslated zh-CN docs emit
noindex,follow; - published zh-CN FAQ does not emit
noindex,follow; - sitemap output includes canonical English docs and excludes untranslated zh-CN docs;
llms.txtrecords the language scope.
The GitHub Pages workflow now runs this audit before uploading the Pages artifact:
.github/workflows/deploy-docs.yml
-> npm run build
-> npm run audit:build
-> upload-pages-artifact
Source Ownership
The language scope is shared through:
website/src/lib/publishedLanguageScope.js
Current values:
publishedZhCnDocIds = faq
publishedZhCnDocPaths = /docs/faq
This module is consumed by:
website/docusaurus.config.jsfor sitemap filtering;website/src/theme/DocItem/Layout/index.jsfor fallback-docnoindex,follow;website/src/pages/index.jsfor zh-CN homepage routing.
This avoids a previous drift pattern where sitemap, noindex, and homepage links each carried a separate copy of the same exception.
For canonical English links rendered from a zh-CN page, use the canonical origin-relative path with autoAddBaseUrl: false and data-noBrokenLinkCheck. Docusaurus checks broken links against the current locale route table, so these intentional cross-locale links must not be "fixed" back to localized fallback routes. npm run audit:build is the guard that proves the final path is correct.
What Was Wrong
The previous Pages state was better than the old roadmap, but still incomplete:
- Docusaurus generated untranslated zh-CN fallback docs.
- Those fallback docs were noindexed and removed from sitemap, which protected crawlers.
- The zh-CN homepage, navbar, and footer still linked users into
/zh-CN/docs/introand similar fallback routes. - The deploy workflow only ran
npm run build; it did not enforce the language route contract.
That means the site could pass build while still presenting a weak public language surface. noindex is not enough when the UI itself sends readers to the wrong locale route.
Better GEO Direction
The better GEO strategy is still truth-first:
- keep English canonical until specific zh-CN pages are fully translated and reviewed;
- only promote a zh-CN doc path by adding it to
publishedLanguageScope.jsin the same batch as the translation; - require
npm run audit:buildbefore Pages deploy; - keep
llms.txt, sitemap, homepage links, and noindex behavior aligned; - expand or consolidate thin provider pages before adding more locale surfaces.
Do not use empty locale folders or fallback English pages as GEO surface area. That produces weak hreflang signals and worse user trust.
Next Direction
- Translate and review the zh-CN critical path in this order: intro, installation, quick-start, configuration, provider overview, AI knowledge pillar.
- Each translated page promotion must update
publishedLanguageScope.jsand rerunnpm --prefix website run build && npm --prefix website run audit:build. - Add a small provider-page quality audit only after the language route gate stays stable; provider thinness is a content quality problem, not a routing problem.
- Keep generated
website/buildoutput ignored and uncommitted.