搭建博客时,参照官网就能够完成基本搭建
可是,也走了些弯路,先纪录下来html
themeConfig配置以下:vue
nav: [ { text: 'home', link: '/' }, { text: 'JS', items: [ { text: 'ES6', link: '/js/ES6/' }, { text: 'Vue', link: '/js/vue/' } ] } ]
sidebar: { '/js/vue/': [ '', // README.md { title: 'vue-router', children: [ ['vueRouter/vueRouter.md', '基础'], ['vueRouter/navigation.md', '导航守卫'] ] } ], '/js/ES6/': [ { title: 'ES6', children: [ ['es6/array.md', '数组方法总结'] ] } ] }
效果以下:git
每一个文件根路径默认为README.md,会被编译成index.html文件es6
使用下面的npm 命令将项目编译成htmlgithub
"docs:build": "vuepress build docs"
而后只将生成后的html项目文件,放到.github.io的仓库里vue-router