Vitepress
Anthony FuCommunityCreated by Anthony Fu
- Skill
- Tool integration
- Software development
- MIT
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
VitePress is a static site generator that transforms Markdown content into a single-page application. It leverages Vite for build processes and Vue 3 for component-based content, allowing developers to integrate Vue components directly into Markdown files. The tool supports file-based routing, theme customization, and provides built-in features for search, internationalization, and server-side rendering compatibility.
What it does
- Generates static HTML from Markdown files
- Enables the use of Vue components within Markdown
- Supports file-based routing and site configuration
- Provides tools for internationalization and multi-language sites
- Offers mechanisms for SSR-compatible code and browser-only component handling
- Includes built-in search and theme customization options
When to use it
- When building documentation sites or technical guides
- When creating blogs or marketing sites using Markdown
- When you need to embed interactive Vue components in static content
- When you require a site with multi-language support
Advantages
- Direct integration of Vue components in Markdown
- File-based routing simplifies site structure
- Built-in support for internationalization and RTL layouts
- Tools for managing browser-only code in an SSR environment
Usage examples
- “How do I configure multiple languages in VitePress?”
- You can define a locales object in your .vitepress/config.ts file to map language codes to specific site configurations and directory structures.
- “How can I use a component that requires the window object?”
- You should wrap the component in a ClientOnly tag or use defineClientComponent to ensure it only loads on the client side, avoiding SSR errors.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/antfu/vitepress/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip vitepress.zip -d .agents/skills
Documentation by Anthony Fu
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
.mdfilesVue 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.tsfor site configurationLook at
.vitepress/theme/for custom theme extensionsThe
public/directory contains static assets served as-is
The skill is based on VitePress 2.0.0-alpha.20, generated at 2026-09-25.
VitePress 2 notes (v1 → v2): install with vitepress@next; requires Node.js 22+. defineConfigWithTheme is deprecated — use defineConfig<ThemeConfig>. Native RTL support (dir option, CSS logical properties) replaces the old PostCSS-plugin approach. Built-in iconify pipeline (icons config, useIcon/VPIcon, collection:name social icons). New assetsBase (CDN) and assetsShards build options; metaChunk removed. Markdown image.lazyLoading renamed to image.lazyLoad.
Core
| Topic | Description | Reference |
|---|---|---|
| Configuration | Config file setup, defineConfig, site metadata | core-config |
| CLI | Command-line interface: dev, build, preview, init | core-cli |
| Routing | File-based routing, source directory, rewrites | core-routing |
| Markdown | Frontmatter, containers, tables, anchors, includes | core-markdown |
Features
Code & Content
| Topic | Description | Reference |
|---|---|---|
| Code Blocks | Syntax highlighting, line highlighting, diffs, focus | features-code-blocks |
| Vue in Markdown | Components, script setup, directives, templating | features-vue |
| Data Loading | Build-time data loaders, createContentLoader | features-data-loading |
| Dynamic Routes | Generate pages from data, paths loader files | features-dynamic-routes |
Theme
| Topic | Description | Reference |
|---|---|---|
| Theme Config | Nav, sidebar, search, social links, footer | theme-config |
| Customization | CSS variables, slots, fonts, global components | theme-customization |
| Custom Theme | Building themes from scratch, theme interface | theme-custom |
Advanced
| Topic | Description | Reference |
|---|---|---|
| Internationalization | Multi-language sites, locale configuration | advanced-i18n |
| SSR Compatibility | Server-side rendering, ClientOnly, dynamic imports | advanced-ssr |
Recipes
| Topic | Description | Reference |
|---|---|---|
| Deployment | GitHub Pages, Netlify, Vercel, Cloudflare, Nginx | recipes-deploy |
Files
- ATTRIBUTION.mdAdded by AutoGineer904 B
- GENERATION.md139 B
- LICENSELicence file added by AutoGineer1.1 KiB
- SKILL.md3.6 KiB
- references/advanced-i18n.md6.3 KiB
- references/advanced-ssr.md4.0 KiB
- references/core-cli.md2.5 KiB
- references/core-config.md7.1 KiB
- references/core-markdown.md6.3 KiB
- references/core-routing.md4.0 KiB
- references/features-code-blocks.md3.6 KiB
- references/features-data-loading.md4.3 KiB
- references/features-dynamic-routes.md4.9 KiB
- references/features-vue.md3.6 KiB
- references/recipes-deploy.md5.3 KiB
- references/theme-config.md6.9 KiB
- references/theme-custom.md5.7 KiB
- references/theme-customization.md8.3 KiB
references/core-markdown.md
name: vitepress-markdown description: Markdown extensions including frontmatter, custom containers, tables, anchors, and file includes
Markdown Extensions
VitePress extends standard markdown with additional features for documentation.
Frontmatter
YAML metadata at the top of markdown files:
---
title: Page Title
description: Page description for SEO
layout: doc
outline: [2, 3]
---
# Content starts hereAccess frontmatter in templates:
# {{ $frontmatter.title }}Or in script:
<script setup>
import { useData } from 'vitepress'
const { frontmatter } = useData()
</script>Custom Containers
Styled callout blocks:
::: info
This is an info box.
:::
::: tip
This is a tip.
:::
::: warning
This is a warning.
:::
::: danger
This is a dangerous warning.
:::
::: details Click to expand
Hidden content here.
:::Custom titles:
::: danger STOP
Do not proceed!
:::
::: details Click me {open}
Open by default with {open} attribute.
:::The no-title attribute renders a container without a title element (no effect
on details):
::: tip {no-title}
Just want to try it out? Skip to the Quickstart.
:::Registering New Containers (v2)
Map new container names to their default titles in config; they behave like the built-in ones (custom titles, attributes, GitHub-alert syntax):
// config.ts
export default {
markdown: {
container: {
customContainers: { success: 'SUCCESS' }
}
}
}New containers ship unstyled — add CSS using the container name as the class:
.custom-block.success {
border-color: transparent;
color: var(--vp-c-text-1);
background-color: var(--vp-c-success-soft);
}Nesting Containers
::: markers follow the same rule as code fences: a fence is closed only by a
matching fence at least as long. Make the outer fence longer to nest:
:::: info Outer container
This box contains another container.
::: details Inner container
Nested content
:::
::::GitHub-flavored Alerts
Alternative syntax using blockquotes:
> [!NOTE]
> Highlights information users should know.
> [!TIP]
> Optional information for success.
> [!WARNING]
> Critical content requiring attention.
> [!CAUTION]
> Negative potential consequences.Text after the marker becomes the alert title: > [!NOTE] Custom Title.
Containers you registered yourself work here too. [!DANGER] is a VitePress
extension (renders as a plain blockquote on GitHub). By default alert colors
match GitHub's (caution and danger both red); enable
themeConfig.gradedContainers for a graded scale (danger red, warning orange,
caution yellow).
Header Anchors
Headers get automatic anchor links. Custom anchors:
# My Heading {#custom-anchor}
[Link to heading](#custom-anchor)Table of Contents
Generate a TOC with:
[[toc]]GitHub-Style Tables
| Feature | Status |
|---------|--------|
| SSR | ✅ |
| HMR | ✅ |Task Lists
- [ ] Write the press release
- [x] Update the websiteFootnotes
Footnotes are supported[^1], including inline ones^[This is an inline footnote.].
[^1]: Definitions can contain **markdown** and render at the end of the page.Emoji
Use shortcodes:
:tada: :rocket: :100:File Includes
Include content from other files:
<!--@include: ./shared/header.md-->With line ranges:
<!--@include: ./code.md{3,10}--> <!-- Lines 3-10 -->
<!--@include: ./code.md{3,}--> <!-- From line 3 -->
<!--@include: ./code.md{,10}--> <!-- Up to line 10 -->With regions:
<!-- In parts/basics.md -->
<!-- #region usage -->
Usage content here
<!-- #endregion usage -->
<!-- Include just that region -->
<!--@include: ./parts/basics.md#usage-->Header anchors work too: <!--@include: ./parts/basics.md#my-heading-->.
Including a missing file/region/anchor or out-of-range lines throws a build error;
set markdown.include.silent: true to warn and skip. Relative links/images in an
included file resolve from the included file's location (disable via
markdown.include.rebaseRelativeUrls: false). To show the directive literally in
docs (e.g. inside a fence), escape it as @@include.
Code Snippet Import
Import code from files:
<<< @/snippets/example.jsWith line highlighting:
<<< @/snippets/example.js{2,4-6}With language override:
<<< @/snippets/example.cs{1,2 c#:line-numbers}Import specific region:
<<< @/snippets/example.js#regionName{1,2}Multiple regions with the same name are concatenated (across comment styles too).
Importing a missing file/region throws a build error — set
markdown.snippet.silent: true to render nothing instead. Extra tokens after the
language are passed as attributes, e.g. {ts twoslash} enables twoslash.
Code Groups
Tab groups for code variants:
::: code-group
```js [config.js]
export default { /* ... */ }
```
```ts [config.ts]
export default defineConfig({ /* ... */ })
```
:::Import files in code groups:
::: code-group
<<< @/snippets/config.js
<<< @/snippets/config.ts
:::Math Equations
Requires setup:
npm add -D markdown-it-mathjax3@^4// .vitepress/config.ts
export default {
markdown: {
math: true
}
}Then use LaTeX:
Inline: $E = mc^2$
Block:
$$
\frac{-b \pm \sqrt{b^2-4ac}}{2a}
$$Image Lazy Loading
export default {
markdown: {
image: {
lazyLoad: true // Renamed from `lazyLoading` in v2
}
}
}Raw Container
Prevent VitePress style conflicts:
::: raw
<CustomComponent />
:::Key Points
Frontmatter supports YAML or JSON format
Custom containers support info, tip, warning, danger, details; register more via
markdown.container.customContainers(v2)Task lists and footnotes are supported
[[toc]]generates table of contents@in imports refers to source root (orsrcDirif configured)Code groups create tabbed code blocks
Math support requires markdown-it-mathjax3 package
v2:
image.lazyLoadingrenamed toimage.lazyLoad; anchor uses@mdit/plugin-anchor, attrs uses@mdit/plugin-attrsInclude/snippet failures throw build errors by default (
markdown.include.silent/markdown.snippet.silentto soften)
<!-- Source references: - https://vitepress.dev/guide/markdown - https://vitepress.dev/guide/frontmatter -->
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Created by
- Anthony Fu
- Publisher
- Anthony Fu (Community)
- Source
- antfu/skills · skills/vitepress · commit f63e9ec
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE.md)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Anthony Fu or Anthony Fu.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download vitepress.zip