Appearance
默认 Badge:default
主题 Badge:
infotipwarningdangeroutlineVitePress1.0.0VitePress 支持多种页面布局:
layout: home)在 Markdown 文件顶部使用 YAML frontmatter:
---
title: 页面标题
description: 页面描述
layout: doc
editLink: true
lastUpdated: true
contributors: true
---首页支持丰富的配置选项:
---
layout: home
hero:
name: "VitePress"
text: "Vue 驱动的高性能静态站点生成器"
tagline: 简单、强大、高性能
actions:
- theme: brand
text: 快速开始
link: /guide/
- theme: alt
text: 查看示例
link: /features
features:
- title: 极速开发
details: 基于 Vite,服务即时启动,刷新即更新
icon: 🚀
- title: 简洁至上
details: Markdown 优先,零配置,开箱即用
icon: ✨
- title: Vue 驱动
details: 利用 Vue 3 的强大能力,轻松扩展
icon: 💚
------
team:
- name: Eric
title: Creator
org: Vite
orgLink: https://vitejs.dev
links:
- icon: github
link: https://github.com/yyx990803
---sidebar: [
{
text: '分组标题',
collapsed: false, // 可折叠
items: [
{ text: '页面1', link: '/page1' },
{ text: '页面2', link: '/page2' }
]
}
]本地搜索配置:
search: {
provider: 'local',
options: {
detailedView: true,
locales: {
'zh-CN': {
translations: {
button: {
buttonText: '搜索',
buttonAriaLabel: '搜索文档'
}
}
}
}
}
}配置 docFooter 以显示上/下篇链接:
docFooter: {
prev: '上一篇',
next: '下一篇'
}outline: {
level: [2, 3], // 显示的标题级别
label: '目录'
}footer: {
message: '基于 MIT 许可证发布',
copyright: 'Copyright © 2023-present'
}editLink: {
pattern: 'https://github.com/vuejs/vitepress/edit/main/docs/:path',
text: '在 GitHub 上编辑此页'
}lastUpdated: {
text: '最后更新于',
formatOptions: {
dateStyle: 'full',
timeStyle: 'short'
}
},
contributors: {
text: '贡献者'
}VitePress 自动支持主题切换:
socialLinks: [
{ icon: 'github', link: 'https://github.com/vuejs/vitepress' },
{ icon: 'twitter', link: 'https://twitter.com/vitepress' },
{ icon: 'discord', link: 'https://discord.gg' }
]logo: '/logo.svg',
siteTitle: 'My VitePress Site'locales: {
'/': {
lang: 'en-US',
title: 'VitePress',
description: 'Static Site Generator'
},
'/zh/': {
lang: 'zh-CN',
title: 'VitePress',
description: '静态站点生成器'
}
}cleanUrls: true生成不带 .html 后缀的 URL。