mirror of https://github.com/vuejs/vitepress
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
150 lines
4.0 KiB
150 lines
4.0 KiB
import { createRequire } from 'module'
|
|
import { defineConfig } from 'vitepress'
|
|
|
|
const require = createRequire(import.meta.url)
|
|
const pkg = require('vitepress/package.json')
|
|
|
|
export default defineConfig({
|
|
lang: 'en-US',
|
|
title: 'VitePress',
|
|
description: 'Vite & Vue powered static site generator.',
|
|
|
|
lastUpdated: true,
|
|
cleanUrls: 'without-subfolders',
|
|
|
|
head: [['meta', { name: 'theme-color', content: '#3c8772' }]],
|
|
|
|
markdown: {
|
|
headers: {
|
|
level: [0, 0]
|
|
}
|
|
},
|
|
|
|
themeConfig: {
|
|
nav: nav(),
|
|
|
|
sidebar: {
|
|
'/guide/': sidebarGuide(),
|
|
'/config/': sidebarConfig()
|
|
},
|
|
|
|
editLink: {
|
|
pattern: 'https://github.com/vuejs/vitepress/edit/main/docs/:path',
|
|
text: 'Edit this page on GitHub'
|
|
},
|
|
|
|
socialLinks: [
|
|
{ icon: 'github', link: 'https://github.com/vuejs/vitepress' }
|
|
],
|
|
|
|
footer: {
|
|
message: 'Released under the MIT License.',
|
|
copyright: 'Copyright © 2019-present Evan You'
|
|
},
|
|
|
|
algolia: {
|
|
appId: '8J64VVRP8K',
|
|
apiKey: 'a18e2f4cc5665f6602c5631fd868adfd',
|
|
indexName: 'vitepress'
|
|
},
|
|
|
|
carbonAds: {
|
|
code: 'CEBDT27Y',
|
|
placement: 'vuejsorg'
|
|
}
|
|
}
|
|
})
|
|
|
|
function nav() {
|
|
return [
|
|
{ text: 'Guide', link: '/guide/what-is-vitepress', activeMatch: '/guide/' },
|
|
{ text: 'Configs', link: '/config/introduction', activeMatch: '/config/' },
|
|
{
|
|
text: pkg.version,
|
|
items: [
|
|
{
|
|
text: 'Changelog',
|
|
link: 'https://github.com/vuejs/vitepress/blob/main/CHANGELOG.md'
|
|
},
|
|
{
|
|
text: 'Contributing',
|
|
link: 'https://github.com/vuejs/vitepress/blob/main/.github/contributing.md'
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
|
|
function sidebarGuide() {
|
|
return [
|
|
{
|
|
text: 'Introduction',
|
|
collapsible: true,
|
|
items: [
|
|
{ text: 'What is VitePress?', link: '/guide/what-is-vitepress' },
|
|
{ text: 'Getting Started', link: '/guide/getting-started' },
|
|
{ text: 'Configuration', link: '/guide/configuration' },
|
|
{ text: 'Deploying', link: '/guide/deploying' }
|
|
]
|
|
},
|
|
{
|
|
text: 'Writing',
|
|
collapsible: true,
|
|
items: [
|
|
{ text: 'Markdown', link: '/guide/markdown' },
|
|
{ text: 'Asset Handling', link: '/guide/asset-handling' },
|
|
{ text: 'Frontmatter', link: '/guide/frontmatter' },
|
|
{ text: 'Using Vue in Markdown', link: '/guide/using-vue' },
|
|
{ text: 'API Reference', link: '/guide/api' }
|
|
]
|
|
},
|
|
{
|
|
text: 'Theme',
|
|
collapsible: true,
|
|
items: [
|
|
{ text: 'Introduction', link: '/guide/theme-introduction' },
|
|
{ text: 'Nav', link: '/guide/theme-nav' },
|
|
{ text: 'Sidebar', link: '/guide/theme-sidebar' },
|
|
{ text: 'Prev Next Link', link: '/guide/theme-prev-next-link' },
|
|
{ text: 'Edit Link', link: '/guide/theme-edit-link' },
|
|
{ text: 'Last Updated', link: '/guide/theme-last-updated' },
|
|
{ text: 'Layout', link: '/guide/theme-layout' },
|
|
{ text: 'Home Page', link: '/guide/theme-home-page' },
|
|
{ text: 'Team Page', link: '/guide/theme-team-page' },
|
|
{ text: 'Badge', link: '/guide/theme-badge' },
|
|
{ text: 'Footer', link: '/guide/theme-footer' },
|
|
{ text: 'Search', link: '/guide/theme-search' },
|
|
{ text: 'Carbon Ads', link: '/guide/theme-carbon-ads' }
|
|
]
|
|
},
|
|
{
|
|
text: 'Migrations',
|
|
collapsible: true,
|
|
items: [
|
|
{
|
|
text: 'Migration from VuePress',
|
|
link: '/guide/migration-from-vuepress'
|
|
},
|
|
{
|
|
text: 'Migration from VitePress 0.x',
|
|
link: '/guide/migration-from-vitepress-0'
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
|
|
function sidebarConfig() {
|
|
return [
|
|
{
|
|
text: 'Config',
|
|
items: [
|
|
{ text: 'Introduction', link: '/config/introduction' },
|
|
{ text: 'App Configs', link: '/config/app-configs' },
|
|
{ text: 'Theme Configs', link: '/config/theme-configs' },
|
|
{ text: 'Frontmatter Configs', link: '/config/frontmatter-configs' }
|
|
]
|
|
}
|
|
]
|
|
}
|