ScriptsApr 12, 2026·2 min read

VitePress — Vite and Vue Powered Static Site Generator

VitePress is a static site generator built on top of Vite and Vue. Designed for documentation websites with Markdown-centered authoring, Vue component extensibility, and lightning-fast dev/build. The successor to VuePress by the Vue.js team.

TL;DR
VitePress builds documentation sites from Markdown with Vue components, Vite HMR, and near-instant builds.
§01

What it is

VitePress is a static site generator built on Vite and Vue.js, designed specifically for documentation websites. It combines Markdown-centered authoring with the ability to embed Vue components directly in Markdown files. Developed by the Vue.js core team as the successor to VuePress, it leverages Vite's instant hot module replacement for a development experience with sub-second feedback loops.

VitePress targets open-source maintainers, developer advocates, and technical writers who need fast, customizable documentation sites without the complexity of a full CMS.

§02

How it saves time or tokens

VitePress eliminates the build time overhead of traditional static site generators. Where Hugo and Jekyll require full rebuilds on content changes, VitePress uses Vite's HMR to update the browser instantly. The default theme provides a complete documentation layout with sidebar navigation, search, dark mode, and i18n out of the box, saving hours of theming work.

§03

How to use

  1. Initialize a VitePress project:
npm i -D vitepress
mkdir docs && echo '# Hello VitePress' > docs/index.md
  1. Start the development server:
npx vitepress dev docs
  1. Configure navigation in docs/.vitepress/config.ts:
import { defineConfig } from 'vitepress'

export default defineConfig({
  title: 'My Docs',
  themeConfig: {
    nav: [
      { text: 'Guide', link: '/guide/' },
      { text: 'API', link: '/api/' }
    ],
    sidebar: [
      { text: 'Getting Started', link: '/guide/' },
      { text: 'Configuration', link: '/guide/config' }
    ]
  }
})
  1. Build for production:
npx vitepress build docs
§04

Example

---
layout: home
hero:
  name: My Project
  text: Documentation made simple
  actions:
    - theme: brand
      text: Get Started
      link: /guide/
    - theme: alt
      text: View on GitHub
      link: https://github.com/my/project
features:
  - title: Fast
    details: Built on Vite with instant HMR
  - title: Flexible
    details: Use Vue components in Markdown
  - title: Searchable
    details: Built-in local search
---
§05

Related on TokRepo

§06

Common pitfalls

  • VitePress is optimized for documentation; using it as a general-purpose blog or marketing site requires significant theme customization
  • Vue components in Markdown are powerful but can break SSG if they access browser-only APIs without <ClientOnly> wrappers
  • The search feature works locally by default; for large sites, consider configuring Algolia DocSearch for better performance

Frequently Asked Questions

How does VitePress differ from VuePress?+

VitePress is the successor to VuePress, rebuilt on Vite instead of webpack. It is significantly faster in both development (instant HMR) and build (Vite bundling). VitePress uses Vue 3 and has a simpler configuration model. VuePress is in maintenance mode.

Can I use Vue components in Markdown?+

Yes. VitePress treats Markdown files as Vue single-file components. You can import and use any Vue component directly in your Markdown. This enables interactive demos, API playgrounds, and dynamic content within documentation pages.

Does VitePress support i18n?+

Yes. VitePress has built-in internationalization support. Configure multiple locales in config.ts, create locale-specific directories, and VitePress generates separate navigation and content for each language with automatic locale switching.

How does search work in VitePress?+

VitePress includes a built-in local search powered by minisearch that indexes all pages at build time. For larger sites, it supports Algolia DocSearch integration for server-side search with typo tolerance and faceted results.

Can VitePress deploy to GitHub Pages?+

Yes. VitePress generates static HTML that deploys to any static hosting service. It includes official guides for GitHub Pages, Netlify, Vercel, and Cloudflare Pages. A GitHub Actions workflow can automate builds on push.

Citations (3)

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets