config.js 1.3 KB
Newer Older
E
Evan You 已提交
1
const fs = require('fs')
E
Evan You 已提交
2
const path = require('path')
E
Evan You 已提交
3
const base = process.env.GH ? '/vuepress/' : '/'
E
Evan You 已提交
4
const { extractHeaders } = require('../../lib')
E
Evan You 已提交
5

E
Evan You 已提交
6
module.exports = {
E
Evan You 已提交
7
  title: 'VuePress',
E
Evan You 已提交
8
  description: 'Vue-powered Static Site Generator',
E
Evan You 已提交
9 10 11
  dest: 'vuepress',
  base,
  head: [
E
Evan You 已提交
12
    ['link', { rel: 'icon', href: `/logo.png` }]
13 14
  ],
  themeConfig: {
E
Evan You 已提交
15
    repo: 'vuejs/vuepress',
E
tweaks  
Evan You 已提交
16
    editLinks: true,
E
Evan You 已提交
17
    docsDir: 'docs',
E
Evan You 已提交
18 19 20
    nav: [
      {
        text: 'Guide',
E
Evan You 已提交
21
        link: '/guide/',
E
Evan You 已提交
22 23 24
      },
      {
        text: 'Config Reference',
E
Evan You 已提交
25
        link: '/config/'
E
tweaks  
Evan You 已提交
26 27 28 29
      },
      {
        text: 'Default Theme Config',
        link: '/default-theme-config/'
E
Evan You 已提交
30
      }
E
Evan You 已提交
31 32
    ],
    sidebar: {
E
Evan You 已提交
33
      '/guide/': [
E
Evan You 已提交
34 35 36 37
        {
          title: 'Guide',
          collapsable: false,
          children: [
E
Evan You 已提交
38
            '',
E
Evan You 已提交
39
            'getting-started',
E
Evan You 已提交
40 41 42 43 44
            'markdown',
            'assets',
            'using-vue',
            'custom-themes',
            'deploy'
E
Evan You 已提交
45 46 47
          ]
        }
      ],
E
Evan You 已提交
48
      '/config/': [
E
Evan You 已提交
49 50 51 52
        {
          title: 'Config Reference',
          collapsable: false,
          children: extractHeaders(
E
Evan You 已提交
53
            fs.readFileSync(path.resolve(__dirname, '../config/README.md'), 'utf-8'),
E
Evan You 已提交
54
            ['h3']
E
Evan You 已提交
55
          ).map(({ title, slug }) => [`#${slug}`, title])
E
Evan You 已提交
56 57 58
        }
      ]
    }
59
  }
E
Evan You 已提交
60
}