VitePress Setup
Configuration for the monorepo's VitePress documentation sites.
Structure
mono/
.vitepress/ ← shared VitePress config
config.mts
theme/
index.ts
Layout.vue
PrevNext.vue
custom.css
notes/ ← docs source
guides/
work/Config Location
| Site | Config |
|---|---|
| mono docs | mono/.vitepress/config.mts |
| ws docs | mono/ws/.vitepress/config.mts |
| di docs | mono/di/.vitepress/config.mts |
Running Locally
bash
# From mono root
yarn docs:dev
# Or from a project
cd ws && yarn docs:devBuilding
bash
yarn docs:buildOutput goes to .vitepress/dist/.
Theme Customizations
The custom theme in .vitepress/theme/ provides:
- PrevNext.vue — navigation arrows in the navbar
- custom.css — sidebar styling, collapsed sections, scrollbar
- index.ts — sidebar toggle persistence via localStorage
Sidebar Generation
The sidebar is auto-generated by notes/tools/docs/sync-sidebar.ts. Run:
bash
yarn docs:syncThis reads the markdown files and updates the sidebar config.
Adding a New Section
- Create the directory in
notes/guides/ - Add an
index.mdfile - Run
yarn docs:syncto update the sidebar - Commit the changes
Troubleshooting
Sidebar not updating
Run yarn docs:sync and check .vitepress/config.mts for syntax errors.
Build fails
Check for:
- Missing
index.mdfiles in directories - Broken links to non-existent pages
- Syntax errors in config.mts
Styles not applying
Clear the VitePress cache:
bash
rm -rf .vitepress/cache
yarn docs:dev