Skip to content

配置说明 ​

配置文件 ​

VitePress 的配置文件位于 .vitepress/config.mts。

站点配置 ​

基础配置 ​

ts
export default defineConfig({
  title: "站点标题",
  description: "站点描述",
  lang: 'zh-CN',
})

主题配置 ​

导航栏 ​

ts
themeConfig: {
  nav: [
    { text: '首页', link: '/' },
    { text: '指南', link: '/guide/' }
  ]
}

侧边栏 ​

ts
themeConfig: {
  sidebar: [
    {
      text: '指南',
      items: [
        { text: '快速开始', link: '/guide/getting-started' }
      ]
    }
  ]
}

社交链接 ​

ts
themeConfig: {
  socialLinks: [
    { icon: 'github', link: 'https://github.com/' }
  ]
}

页面配置 ​

在 Markdown 文件顶部使用 frontmatter 配置页面:

yaml
---
layout: doc
title: 页面标题
---

更多配置 ​

查看 VitePress 官方文档 了解更多配置选项。