Install
openclaw skills install @makiwinster72/vitepress-configVitePress static site generator toolkit. Use when working with VitePress configuration, theming, routing, markdown, Vue in markdown, data loading, custom themes, SSR, i18n, or deployment. Triggers: vitepress config, site-config, theme config, .vitepress/config, frontmatter, vitepress dev/build/preview, markdown extensions, custom theme, data loader.
openclaw skills install @makiwinster72/vitepress-configVue-powered static site generator for documentation, blogs, and marketing sites.
npm add -D vitepress@next
npx vitepress init
npm run docs:dev
import { defineConfig } from 'vitepress'
export default defineConfig({
title: 'My Site',
description: 'Site description',
base: '/docs/', // for sub-path deployment
srcDir: './src', // markdown source directory
cleanUrls: true, // remove .html
appearance: 'dark', // dark mode
lastUpdated: true, // Git-based timestamps
themeConfig: {
logo: '/logo.svg',
nav: [
{ text: 'Guide', link: '/guide/' },
{ text: 'Config', link: '/reference/site-config' }
],
sidebar: [
{ text: 'Section', items: [{ text: 'Page', link: '/page' }] }
],
search: { provider: 'local' }
}
})
---
title: Page Title
layout: doc # doc | home | page
navbar: true
sidebar: true
outline: [2, 3] # show h2-h3 in aside
lastUpdated: true
editLink: true
footer: true
---
Home page hero:
---
layout: home
hero:
name: VitePress
text: Static site generator
actions:
- theme: brand
text: Get Started
link: /guide/getting-started
features:
- icon: 🛠️
title: Fast
details: Built with Vite
---
## Custom anchor {#custom}
::: info
Info box
:::
```js{2}
const x = 1 // highlight line 2
:::
<<< @/snippets/file.js{1}
[[toc]]
## Routing
index.md --> / guide/start.md --> /guide/start/
Dynamic routes: `packages/[pkg].md` + `packages/[pkg].paths.js`
## Custom Theme
```javascript
// .vitepress/theme/index.js
import Layout from './Layout.vue'
export default { Layout }
<!-- Layout.vue -->
<template>
<h1>Custom Layout!</h1>
<Content />
</template>
Extend default theme:
import DefaultTheme from 'vitepress/theme'
export default { extends: DefaultTheme }
// .vitepress/posts.data.js
import { createContentLoader } from 'vitepress'
export default createContentLoader('posts/*.md', {
transform: (data) => data.sort(/* ... */)
})
<script setup>
import { data } from './posts.data.js'
</script>
<ClientOnly>
<BrowserOnlyComponent />
</ClientOnly>
vitepress dev docs # start dev server
vitepress build docs # build for production
vitepress preview docs # preview production build
Detailed docs in references/ directory:
what-is-vitepress.md - What is VitePress, use cases, performancegetting-started.md - Installation and setuprouting.md - File routing, clean URLs, rewrites, dynamic routesmarkdown.md - Markdown extensions syntaxasset-handling.md - Static assets, public directory, base URLusing-vue.md - Using Vue in markdown, components, directivesextending-default-theme.md - CSS customization, layout slots, view transitionscustom-theme.md - Building custom themesdata-loading-ssr-i18n.md - Data loaders, SSR, i18nmpa-mode.md - MPA mode for zero-JS sitessitemap-generation.md - Sitemap generationcms.md - Connecting to CMSdeploy.md - Deployment guides for various platformssite-config.md - All config options and build hooksfrontmatter.md - Page frontmatter optionsruntime-api.md - useData, useRoute, useRouter, withBasecli.md - Command line optionsdefault-theme-config.md - Nav, sidebar, search, footer optionsdefault-theme-components.md - Hero, features, badge, team page