我希望每个页面都有自定义链接和不同的侧边栏我不希望我的标题呈现为侧边栏中的目录我希望有这样的自定义内容。
Node JS
-Lecture 1 Introduction
--Sub Lecture
-Lecture 2 Basics
--Sub Lecture
---Nested Lecture
所有讲座都是自定义链接。那我该怎么做。
类型:false | 'auto' | SidebarConfigArray | SidebarConfigObject
默认:'auto'
细节:
侧边栏的配置。
你可以通过页面中的侧边栏 frontmatter 覆盖此全局选项。
设置false
为禁用侧边栏。
如果将其设置为'auto'
,则侧边栏将从页眉中自动生成。
要手动配置侧边栏项目,你可以将此选项设置为侧边栏数组,其中每个项目可以是SidebarItem
对象或字符串:
SidebarItem
对象应该有一个text
字段,可以有一个可选link
字段和一个可选children
字段。该children
字段应该是一个侧边栏数组。SidebarItem
对象,该对象text
是页面标题,link
是页面路由路径,并且children
是从页面标题自动生成的。如果要为不同的子路径设置不同的侧边栏,可以将此选项设置为侧边栏对象:
为了在外部和内部添加自定义链接,请参见:
module.exports = {
themeConfig: {
// sidebar object
// pages under different sub paths will use different sidebar
sidebar: {
'/guide/': [
{
text: 'Guide',
children: ['/guide/README.md', '/guide/getting-started.md'],
},
],
'/reference/': [
{
text: 'Reference',
children: ['/reference/cli.md', '/reference/config.md'],
},
],
},
},
}
有关更多信息,请参阅侧边栏配置