基础配置

  • .vuepress/config.js
const navConfig = require('../../config/navConfig.js')
const sidebarConfig = require('../../config/sidebarConfig.js')

module.exports = {
    title: 'qingmang', //网站的标题
    description: '少年壮志当凌云 仗剑携酒江湖行', //网站的描述
    head: [
        ['link', { rel: 'icon', href: '/img/favicon.ico' }], //自定义的 favicon
        ['meta', { name: 'viewport', content: 'width=device-width,initial-scale=1,user-scalable=no' }] //移动端优化
    ],
    port: 8081, //端口
    themeConfig: { //主题
        lastUpdated: 'Last Updated', //最后更新时间
        nav: navConfig, //导航栏
        sidebar: sidebarConfig, //侧边栏
        sidebarDepth: 2, //最大的深度为 2,它将同时提取 h2 和 h3 标题
    },
    markdown: { //markdown
        lineNumbers: true //显示行号
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  • config/navConfig.js是把导航栏单独提出来,因为都放在config.js文件中会使其比较臃肿
module.exports = [
    { text: 'Home', link: '/' },
    { text: '指南', link: '/base/' },
    { text: 'Github', link: 'https://github.com/muou2125' },
    // { //可下拉菜单
    //     text: 'Languages',
    //     items: [
    //         { text: 'Chinese', link: '/language/chinese' },
    //         { text: 'Japanese', link: '/language/japanese' }
    //     ]
    // }
]
1
2
3
4
5
6
7
8
9
10
11
12
  • config/sidebarConfig.js单独提出来,原因同上
module.exports = [
    {
        title: '基础',
        collapsable: true,
        children: [
            ['/base/', '安装/使用'],
            ['/base/baseMenu', '项目完整目录'],
            ['/base/baseConfig', '基本配置']
        ]
    },
    {
        title: '注意事项',
        collapsable: true,
        children: [
            ['/problem/', '开发文档阅读'],
            ['/problem/problemRoot', '/ 根目录问题'],
            ['/problem/problemMobile', '移动端适配问题'],
            ['/problem/problemStyle', '自定义样式问题']
        ]
    }
]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Last Updated: 8/19/2019, 5:15:28 PM