Migrate from VitePress
VitePress content is Markdown, but it is parsed by Markdown-It and can embed Vue templates and components. Plain pages move easily; custom containers, code groups, theme slots, and Vue behavior need explicit conversion.
Markdown is portable; Vue templates are not
Copy prose and standard Markdown first. Treat every imported or globally registered Vue component as application code that must be replaced for the selected target runtime.
1. Inventory the source
Record:
- the VitePress root and optional
srcDir .vitepress/config.*and imported config helpers.vitepress/theme/, globally registered components, and custom CSSthemeConfig.navand everythemeConfig.sidebarvariantbase,cleanUrls,rewrites, and locale configuration- Markdown-It plugins and custom containers
public/, relative assets, and imported images- search, sitemap, analytics, head tags, and deployment settings
2. Map the files
| VitePress | Farming Labs Docs |
|---|---|
Markdown root or srcDir | Target docs content tree |
.vitepress/config.* | docs.config.ts and host/runtime config |
themeConfig.sidebar | Directory hierarchy and page order |
themeConfig.nav | Application navigation |
.vitepress/theme/index.* | Theme selection and registered components |
.vitepress/theme/custom.css | Global CSS or theme overrides |
public/** | Target public/static directory |
route rewrites | File paths or host/runtime redirects |
3. Preserve routing
VitePress routes depend on the content root, srcDir, base, clean URLs, and rewrites. Build a
source route list before moving files.
For each page:
- preserve the URL path through the destination file structure
- keep
title,description, and portable frontmatter - preserve explicit heading IDs used by external links
- include the old
baseprefix in the targetentryor redirect it - convert
rewritesinto actual destination paths or redirects
Do not assume a file's repository path equals its published path.
4. Rebuild nav and sidebar
VitePress top navigation and sidebars are separate:
- Translate
themeConfig.navinto the target application's top navigation. - Turn sidebar groups into directories and folder landing pages.
- Preserve item order with numeric
orderfrontmatter. - Recreate per-path sidebar objects as separate content sections.
- Preserve collapsed/expanded intent where the target sidebar supports it.
- Keep external links explicit.
Generated sidebar functions should be evaluated into a stable inventory before migration.
5. Convert Markdown extensions
| VitePress syntax | Target |
|---|---|
::: info, ::: tip, ::: warning, ::: danger | <Callout> or supported directive |
::: details | <details> and <summary> |
::: code-group | <Tabs> with code blocks |
| line highlights and code focus metadata | Supported code fence metadata |
| Markdown-It attributes or plugins | Portable Markdown, MDX, or an adapter plugin |
<Badge> | Text badge component or plain inline text |
| raw Vue interpolation/directives | Static content or target-native component |
Check code fences carefully because VitePress uses its own highlight and line-focus notation.
6. Replace Vue components and theme behavior
Search pages for:
.vueimports- globally registered component tags
- Vue directives such as
v-if,v-for, andv-bind - mustache interpolation
<script setup>- theme slots and layout overrides
For an Astro or Svelte target, rewrite them as native components. For Next.js or TanStack Start, rewrite interactive blocks as React components. For static behavior, prefer plain Markdown.
7. Move assets and integrations
Copy public/ to the target public/static directory and keep root-relative URLs stable. Verify
assets imported from Markdown or Vue components separately.
Recreate search, analytics, sitemap, social metadata, edit links, last-updated behavior, and deployment base settings through Farming Labs and the target application.
8. Validate and recover
- Run the target production build.
- Compare routes after applying the old base and rewrites.
- Test custom containers, code groups, heading anchors, and code highlights.
- Inspect pages containing Vue imports or directives.
- Compare each sidebar variant and locale.
- Fetch representative pages through
.md.
If compilation fails, locate the first remaining Vue or Markdown-It-only construct and convert that family across the corpus. If links fail, compare against the resolved VitePress route—not only the source filename.
Source references
Migrate VitePress Markdown, sidebar configuration, Vue components, containers, and assets
How is this guide?