vuepress需要手动设置侧边栏、导航栏,导入大量笔

前言:

vuepress需要手动设置侧边栏、导航栏,导入大量笔记就很费时间。为了能够专心写作而不用去管侧边栏、导航栏的引入,读取大量资料,改进了下面函数

下载

npm i vuepress-sidebar-atuo 引入

const {getChildren} = require("vuepress-sidebar-atuo") 使用

module.exports = { '/views/': [ { title: '基础知识', collapsable: true, children: getChildren('./docs/views/basis/') }, { title: '高级进阶', collapsable: true, children: getChildren('./docs/views/advanced/') }, '/jottings/':[ { title: '随笔', collapsable: true, children: getChildren('./docs/jottings/') }, ], //... `这样就配置完成了` 排序

-文件名格式 不设置则排最后 数值越小,越靠前

xxxxx-01, xxxxx-02, xxxxx-03 ...

查看效果--->

源码 github

效果 malunan的blog

版权声明:

1、该文章(资料)来源于互联网公开信息,我方只是对该内容做点评,所分享的下载地址为原作者公开地址。
2、网站不提供资料下载,如需下载请到原作者页面进行下载。