docs/contribute-to-docs.md
This documentation site is built with VitePress and lives in the
docs/ directory of the main repository.
Improving the docs — fixing a typo, clarifying a step, adding an example, or translating a page — is
one of the easiest ways to make your first contribution.
Every page has an "Edit this page on GitHub" link at the bottom. Click it to open the source file directly in GitHub's editor, make your change, and submit a pull request — no local setup required.
For larger changes, preview the site on your machine:
cd docs
npm install
npm run docs:dev # local dev server with hot reload
npm run docs:build # production build (what CI deploys)
The site follows the standard VitePress i18n layout. English is the default locale at the root,
and Simplified Chinese mirrors it under zh/ with identical relative paths:
docs/
├── index.md # English home
├── guide/quick-start.md # English
├── PROJECT_MODULES.md # English
├── zh/
│ ├── index.md # 中文首页
│ ├── guide/quick-start.md # 中文
│ └── PROJECT_MODULES.md # 中文
├── imgs/ # shared images (referenced by both locales)
└── .vitepress/config.mts # nav & sidebar for both locales
Rule of thumb: a page at docs/X.md (English) has its Chinese counterpart at docs/zh/X.md. Keep the
two paths in sync so the structure never drifts.
docs/guide/my-page.md).zh/ (e.g. docs/zh/guide/my-page.md).sidebar (and nav if needed) for both locales in
docs/.vitepress/config.mts.docs/imgs/ (use ./imgs/... from the root, ../imgs/... from zh/).Only comfortable in one language? Submit the page you can write and open an issue (or note it in your PR) so a maintainer or another contributor can add the other locale. Don't leave the trees mismatched silently.
git checkout -b docs/my-change
git commit -s -m "docs: describe your change" # -s adds the DCO sign-off (required)
git push origin docs/my-change
Then open a pull request against main. CI builds the site to validate your change; once merged, the
live site is deployed automatically.