Skip to content

About

Template for Documents hosting repo, build with VitePress!

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

13 Commits

Folders and files

Repository files navigation

template-docs-vitepress

A reusable documentation site template built with VitePress.

Note

This template tracks the VitePress 2 pre-release line (currently 2.0.0-alpha.21) — a deliberate exception to this template family's "no pre-release deps" convention. VitePress 1.6.4 — the last stable release, from August 2025 — pins Vite 5, which carries an unfixable high-severity path-traversal advisory in its dev server (GHSA-67mh-4wv8-2f99 and related). Forcing a newer Vite via overrides does not work: VitePress 1.x calls transformWithEsbuild, which Vite 8 removed. VitePress 2 runs on Vite 8 (via 2.0.0-alpha.21) and npm audit is clean. Re-checked during the 2026-11-30 weekly dependency pass — 2.0.0-alpha.21 is still the newest alpha and the build still works. Move to ^2.0.0 once it ships stable.

Prerequisites

  • Node.js 26 or later
  • npm >= 12. Node 26 bundles npm 11, so run npm install -g npm@12 once per Node install. Enforced by devEngines: on an older Node or npm, npm commands fail with EBADDEVENGINES.

Commands

npm i                 # install dependencies + git hooks (lefthook)
npm run docs:dev     # start local dev server
npm run docs:build   # build for production
npm run docs:preview # preview the production build
npm run lint         # Biome check (lint + format + import order)
npm run lint:fix     # Biome check with autofix

Biome (a single Rust binary) lints and formats the config, theme and components, the same way as the other template-* repos. A lefthook pre-commit hook runs it on staged files. Markdown under content/ isn't touched by it.

Structure

Docs content and site config/theme live in separate top-level folders:

content/               # docs content only — edit this for pages
├── index.md          # home page
├── guide/
│   ├── index.md
│   ├── getting-started.md
│   └── vue-components.md
└── public/            # static assets (logo, images, etc.)

.vitepress/             # config + theme only
├── config.ts          # nav, sidebar, theme, and search config (srcDir: "content")
└── theme/             # custom theme and components

To adapt this template, edit the pages under content/ and update the nav/sidebar in .vitepress/config.ts to match.

Notes

  • notes/authentication.md — options for adding an auth layer in front of this docs site, if a project needs to restrict access.

About

Template for Documents hosting repo, build with VitePress!

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages