Overview

VitePress Config

Config options, transformPageData, and SEO

Overview

Config lives in .vitepress/config.ts. It reads settings.json and home.json from .vitepress/data/ for site name, domain, and SEO.

Key options

  • srcDir: 'pages' — VitePress pages in pages/
  • cleanUrls: true — No .html in URLs
  • titleTemplate: false — We handle titles in transformPageData
  • vite.server.port: 5657 — Dev server port

transformPageData

Runs at build time for each page. It:

  • Sets pageData.title from seo.metaTitle or title, with site name suffix
  • Sets pageData.description for meta description
  • Adds meta tags: og:title, og:description, og:image, canonical, noindex

For the home page, it reads home.json. For other pages, it uses pageData.params (from [slug].paths.ts).

Aliases

Vite resolve aliases:

  • @theme.vitepress/theme/
  • @scriptsscripts/

Next: Pages

Menu
In this section