将 nav 和 sidebar 配置独立出来形成单独文件
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import { defineConfig } from 'vitepress'
|
||||
import { sidebar } from '../sidebar.mts'
|
||||
import { nav } from '../nav.mts'
|
||||
|
||||
// https://vitepress.dev/reference/site-config
|
||||
export default defineConfig({
|
||||
@@ -15,20 +17,9 @@ export default defineConfig({
|
||||
src: '/public/assets/logo.svg',
|
||||
},
|
||||
|
||||
nav: [
|
||||
{ text: 'Home', link: '/' },
|
||||
{ text: 'Examples', link: '/markdown-examples' }
|
||||
],
|
||||
nav: nav,
|
||||
|
||||
sidebar: [
|
||||
{
|
||||
text: 'Examples',
|
||||
items: [
|
||||
{ text: 'Markdown Examples', link: '/markdown-examples' },
|
||||
{ text: 'Runtime API Examples', link: '/api-examples' }
|
||||
]
|
||||
}
|
||||
],
|
||||
sidebar: sidebar,
|
||||
|
||||
socialLinks: [
|
||||
{ icon: 'github', link: 'https://github.com/vuejs/vitepress' }
|
||||
|
6
docs/nav.mts
Normal file
6
docs/nav.mts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { DefaultTheme } from 'vitepress'
|
||||
|
||||
export const nav: DefaultTheme.NavItem[] = [
|
||||
{ text: 'Home', link: '/' },
|
||||
{ text: 'Examples', link: '/markdown-examples' }
|
||||
]
|
11
docs/sidebar.mts
Normal file
11
docs/sidebar.mts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { DefaultTheme } from 'vitepress'
|
||||
|
||||
export const sidebar: DefaultTheme.Sidebar = [
|
||||
{
|
||||
text: 'Examples',
|
||||
items: [
|
||||
{ text: 'Markdown Examples', link: '/markdown-examples' },
|
||||
{ text: 'Runtime API Examples', link: '/api-examples' }
|
||||
]
|
||||
}
|
||||
]
|
Reference in New Issue
Block a user