Documentation site development
The site uses a custom VitePress theme. Content comes from maintained Markdown, structured landing-page data, and pages synced / generated during builds. Check the source before editing and synchronize Chinese and English.
Before Editing
- Home / landing page → edit
.vitepress/data/*.ts quick-start/changelog→ edit the rootREADME/CHANGELOG- Submodule-synced pages → edit the submodule source repo, then bump the pointer in the parent
repowiki→ edit the tracked Markdown directly- Other maintained pages → edit the corresponding Chinese and English files
Local preview and builds
cd docs
npm ci
npm run docs:dev
# Build and preview the production output
npm run docs:build
npm run docs:previewdocs:dev listens on http://localhost:3030. Both docs:dev and docs:build run sync, fetch-issues, and swagger-to-md before VitePress. Use docs:preview for built output; avoid running the dev server during a production build, which makes its watcher process large changes under .vitepress/dist.
Content sources
| Page / file | Source | Where to edit |
|---|---|---|
index.md / en/index.md | Custom landing | .vitepress/data/*.ts, .vitepress/theme/components/landing/*.vue |
faq.md / architecture*.md / clients.md / repowiki/** | Maintained Markdown | Corresponding Chinese and English files |
quick-start.md / en/quick-start.md | Synced | Root README.md / README.en.md |
changelog.md | Synced | Root CHANGELOG.md |
NOTICE.md / PRIVACY.md / TERMS.md and English variants | Synced | Corresponding root statements |
player/** / en/player/** / player-lynx/** / en/player-lynx/** | Synced from client submodules | Flutter's docs/cn and docs/en, and the public Lynx guides. See the mappings in sync-docs.mjs |
addon/** / plugin-toolchain/** | Synced from submodules | Sources listed in sync-docs.mjs |
swagger.json / swagger.yaml / docs.go | Generated by swag, tracked | Handler annotations + make swagger |
swagger-api/** | Generated during builds, ignored | docs/swagger.json → scripts/swagger-to-md.mjs |
issues/** | Generated from GitHub, ignored | Issues labeled 文档 |
Landing index.md only mounts <Landing />. Installation options live in downloads.ts, features in features.ts, and shared copy in landing-i18n.ts. Keep each {zh,en} pair synchronized.
repowiki is tracked, maintained Markdown with no regeneration script in this repository. Edit relevant pages when code changes; it differs from the ignored Swagger API pages.
Edit submodule documentation in its source repository, then update the parent pointer. The to: target paths in sync-docs.mjs are deliberately decoupled from source paths (e.g. integrations/home-assistant/README.md → docs/addon/index.md), because public URLs such as /addon/ are already in the sitemap and must not follow source-repo renames. The sync script only warns when a submodule is absent, so pages silently disappear; the initialization list in .github/workflows/static.yml must include them.
Sync and generation scripts
scripts/sync-docs.mjssyncs root and submodule documents and rewrites relative links. Public target URLs can differ from source paths.scripts/fetch-issues.mjsreads GitHub issues. WithoutVITE_GITHUB_ISSUES_TOKEN, it clears previous generated pages and skips fetching.scripts/swagger-to-md.mjsconverts tracked Swagger JSON to ignored API Markdown. Add handler annotations and runmake swaggerbefore documenting new endpoints.
These steps must run before VitePress scans pages. Check docs/.gitignore for exact boundaries; some generated files are tracked.
