搭建博客時,參照官網就能夠完成基本搭建
可是,也走了些彎路,先紀錄下來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