Skip to content

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

SiteConfig
mono docsmono/.vitepress/config.mts
ws docsmono/ws/.vitepress/config.mts
di docsmono/di/.vitepress/config.mts

Running Locally

bash
# From mono root
yarn docs:dev

# Or from a project
cd ws && yarn docs:dev

Building

bash
yarn docs:build

Output 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

The sidebar is auto-generated by notes/tools/docs/sync-sidebar.ts. Run:

bash
yarn docs:sync

This reads the markdown files and updates the sidebar config.

Adding a New Section

  1. Create the directory in notes/guides/
  2. Add an index.md file
  3. Run yarn docs:sync to update the sidebar
  4. Commit the changes

Troubleshooting

Run yarn docs:sync and check .vitepress/config.mts for syntax errors.

Build fails

Check for:

  • Missing index.md files 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