vitepress

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
VitePress is a Static Site Generator (SSG) built on Vite and Vue 3. It takes Markdown content, applies a theme, and generates static HTML that becomes an SPA for fast navigation. Perfect for documentation, blogs, and marketing sites.
Key Characteristics:
  • File-based routing with
    .md
    files
  • Vue components work directly in Markdown
  • Fast HMR with instant updates (<100ms)
  • Default theme optimized for documentation
  • Built-in search (local or Algolia)
Before working with VitePress projects:
  • Check
    .vitepress/config.ts
    for site configuration
  • Look at
    .vitepress/theme/
    for custom theme extensions
  • The
    public/
    directory contains static assets served as-is
The skill is based on VitePress 1.x, generated at 2026-01-28.
VitePress是基于Vite和Vue 3的静态网站生成器(SSG)。它接收Markdown内容,应用主题,生成可作为单页应用(SPA)的静态HTML,实现快速导航。非常适合用于文档、博客和营销站点。
核心特性:
  • 基于
    .md
    文件的文件式路由
  • Vue组件可直接在Markdown中使用
  • 快速热模块替换(HMR),即时更新(<100ms)
  • 针对文档优化的默认主题
  • 内置搜索功能(本地搜索或Algolia搜索)
在处理VitePress项目之前:
  • 查看
    .vitepress/config.ts
    文件获取站点配置信息
  • 查看
    .vitepress/theme/
    目录了解自定义主题扩展
  • public/
    目录包含直接提供的静态资源
本技能基于VitePress 1.x版本,生成于2026年1月28日。

Core

核心功能

TopicDescriptionReference
ConfigurationConfig file setup, defineConfig, site metadatacore-config
CLICommand-line interface: dev, build, preview, initcore-cli
RoutingFile-based routing, source directory, rewritescore-routing
MarkdownFrontmatter, containers, tables, anchors, includescore-markdown
主题描述参考链接
配置配置文件设置、defineConfig、站点元数据core-config
CLI(命令行界面)命令行工具:dev、build、preview、initcore-cli
路由文件式路由、源目录、重写规则core-routing
Markdown前置元数据(Frontmatter)、容器、表格、锚点、包含文件core-markdown

Features

功能特性

Code & Content

代码与内容

TopicDescriptionReference
Code BlocksSyntax highlighting, line highlighting, diffs, focusfeatures-code-blocks
Vue in MarkdownComponents, script setup, directives, templatingfeatures-vue
Data LoadingBuild-time data loaders, createContentLoaderfeatures-data-loading
Dynamic RoutesGenerate pages from data, paths loader filesfeatures-dynamic-routes
主题描述参考链接
代码块语法高亮、行高亮、差异对比、聚焦显示features-code-blocks
Markdown中的Vue组件、script setup、指令、模板features-vue
数据加载构建时数据加载器、createContentLoaderfeatures-data-loading
动态路由从数据生成页面、路径加载器文件features-dynamic-routes

Theme

主题

TopicDescriptionReference
Theme ConfigNav, sidebar, search, social links, footertheme-config
CustomizationCSS variables, slots, fonts, global componentstheme-customization
Custom ThemeBuilding themes from scratch, theme interfacetheme-custom
主题描述参考链接
主题配置导航栏、侧边栏、搜索、社交链接、页脚theme-config
自定义CSS变量、插槽、字体、全局组件theme-customization
自定义主题从零开始构建主题、主题接口theme-custom

Advanced

进阶功能

TopicDescriptionReference
InternationalizationMulti-language sites, locale configurationadvanced-i18n
SSR CompatibilityServer-side rendering, ClientOnly, dynamic importsadvanced-ssr
主题描述参考链接
国际化多语言站点、区域设置配置advanced-i18n
SSR兼容性服务器端渲染、ClientOnly、动态导入advanced-ssr

Recipes

实践方案

TopicDescriptionReference
DeploymentGitHub Pages, Netlify, Vercel, Cloudflare, Nginxrecipes-deploy
主题描述参考链接
部署GitHub Pages、Netlify、Vercel、Cloudflare、Nginxrecipes-deploy