VitePress Configuration
Documentation is built with VitePress, a static site generator optimized for technical documentation.
Configuration File
Main configuration: docs/.vitepress/config.mts
This file defines:
- Site metadata (title, description)
- Theme configuration
- Sidebar navigation
- Build settings
- Markdown extensions
Adding New Pages
1. Create the Markdown File
# Example: Add an Azure deployment guide
docs/guide/deployment/azure.md2. Write the Content
Use frontmatter for page metadata:
---
title: Azure Deployment
description: Deploy the platform to Azure
# Deploy to Azure
This guide shows how to deploy the platform to Azure...3. Update the Sidebar
Edit the appropriate sidebar file in docs/.vitepress/sidebar/:
Example: guide.ts
export default [
{
text: 'Deployment',
collapsed: true,
items: [
{ text: 'Azure Deployment', link: '/guide/deployment/azure' },
{ text: 'Local Development', link: '/guide/deployment/local' }
]
}
]4. Test Locally
cd docs
npm run docs:dev
# Visit http://localhost:5173Sidebar Files
Each documentation section has its own sidebar configuration:
| Section | Sidebar File | Mapped Path |
|---|---|---|
| User Guide | sidebar/guide.ts | /guide/ |
| Integration | sidebar/integration.ts | /integration/ |
| Developer | sidebar/developer.ts | /developer/ |
| Reference | sidebar/reference.ts | /reference/ |
Sidebar Structure
When adding or reorganising sidebar entries, follow these principles:
| Principle | Rule |
|---|---|
| Journey ordering | Sections appear in the order a new reader encounters them: learn the system, build artifacts, understand cross-cutting concerns, contribute. Within a section: overview → concepts → details → tooling. |
| Dependency direction | If section B assumes knowledge from section A, A must appear first. |
| Cognitive proximity | Items that answer the same kind of question sit together. Use inline comments (// Protocols, // Tooling, …) to label each cluster. |
| Consistent entry points | Every group with more than two items starts with an Overview page. |
| Max depth ≤ 3 | No page should require more than two clicks from the sidebar root. |
| Group size 2–8 | A single child is pointless nesting; 10+ children needs splitting. |
Promote a topic to its own top-level section when it has an independent entry point, cuts across multiple deliverables, introduces its own vocabulary, has 3+ pages, and maps to a codebase boundary. Otherwise keep it as a sub-group.
Basic sidebar configuration:
export default [
{
text: 'Section Name',
collapsed: true, // Can be expanded/collapsed
items: [
{ text: 'Page Title', link: '/path/to/page' },
{
text: 'Subsection',
collapsed: true,
items: [
{ text: 'Nested Page', link: '/path/to/nested' }
]
}
]
}
]Sidebar Mapping
Sidebars are mapped to paths in config.mts:
export default defineConfig({
themeConfig: {
sidebar: {
'/guide/': guide,
'/integration/': integration,
'/developer/': developer,
'/reference/': reference
}
}
})Navigation
Top navigation is configured in config.mts:
export default defineConfig({
themeConfig: {
nav: [
{ text: 'Guide', link: '/guide/' },
{ text: 'Integration', link: '/integration/' },
{ text: 'Developer', link: '/developer/' },
{ text: 'Reference', link: '/reference/' }
]
}
})Markdown Extensions
VitePress supports enhanced Markdown:
Frontmatter
---
title: Page Title
description: Page description for SEO
layout: doc
---Code Groups
::: code-group
```bash [npm]
npm run docs:dev
\```
```bash [yarn]
yarn docs:dev
\```
:::For callouts, links, diagrams, and other formatting conventions, see the Writing Guidelines.
Building Documentation
Local Development
Start development server with hot reload:
cd docs
npm run docs:devFeatures:
- Hot module replacement
- Live preview at
http://localhost:5173 - Automatic page refresh on file changes
Production Build
Build static site for deployment:
cd docs
npm run docs:buildOutput: docs/.vitepress/dist/
Preview Production Build
Test the production build locally:
cd docs
npm run docs:previewThis serves the built site from dist/ to verify the production build.
Deployment
The documentation is automatically deployed when:
- Changes are pushed to the main branch
- A pull request is merged
- A release is created
Deployment targets:
- Azure Static Web Apps
- GitHub Pages (optional)
- Custom hosting (configurable)
Advanced Configuration
Custom Theme
Extend the default theme in .vitepress/theme/index.ts:
import DefaultTheme from 'vitepress/theme'
import './custom.css'
export default {
...DefaultTheme,
enhanceApp({ app }) {
// Register custom components
}
}Search Configuration
VitePress includes built-in local search:
export default defineConfig({
themeConfig: {
search: {
provider: 'local'
}
}
})Markdown Configuration
Customize Markdown processing in config.mts:
export default defineConfig({
markdown: {
theme: 'github-dark',
lineNumbers: true
}
})Link Format
Internal links use absolute paths without .md extension: /guide/getting-started
See the Writing Guidelines for full link formatting conventions.
Common Issues
Links not working
Problem: Internal links are broken
Solution: Use absolute paths without .md:
[Link](/guide/page) # Not: guide/page.mdSidebar not showing
Problem: Sidebar doesn't appear for new section
Solution: Verify path mapping in config.mts:
sidebar: {
'/new-section/': newSectionSidebar
}Build errors
Common causes:
- Broken internal links
- Invalid frontmatter YAML
- Missing images
- Markdown syntax errors
Fix: Check build output for specific error messages.
Images not loading
Problem: Images don't display
Solution:
- Place images in
docs/assets/ - Reference with absolute path:

Best Practices
Do ✅
- Use semantic file and folder names
- Keep sidebar hierarchy shallow (max 3 levels)
- Test links after adding pages
- Use frontmatter for metadata
- Group related pages in folders
- Build and preview before deploying
Don't ❌
- Create deep navigation hierarchies
- Use relative paths for internal links
- Include
.mdextension in links - Forget to update sidebars
- Use spaces in filenames (use hyphens)
- Commit build output to Git