sidebar.js配置
自动生成的sidebar可以和自定义连接,结合在一起。例如下面官方文档:
module.exports = {
community: [
{
type: 'autogenerated',
dirName: '.',
},
{
type: 'link',
href: '/changelog',
label: 'Changelog',
},
{
type: 'link',
href: '/showcase',
label: 'Showcase',
},
{
type: 'link',
href: '/feature-requests',
label: 'Feature Requests',
},
{
type: 'link',
label: 'Chat with us on Discord',
href: 'https://discord.gg/docusaurus',
},
],
};
体面的。
根据提供的代码,可以看出 "community" 数组中的第一个对象具有 "type" 属性设置为 "autogenerated",这意味着它是一个自动生成的文档页面。
同时,数组中的其他对象是链接类型,它们具有 "type" 属性设置为 "link",并且包含了 "href" 和 "label" 属性。这意味着可以将自动生成的文档页面与自定义链接结合起来,以创建一个包含各种类型链接的社区导航栏或菜单。
例如,可以在自动生成的文档页面之后添加其他链接,如 "Changelog"、"Showcase"、"Feature Requests" 和 "Chat with us on Discord",以提供更多的社区相关功能和导航选项。