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

E
Evan You 已提交
5
module.exports = {
E
Evan You 已提交
6
  title: 'VuePress',
E
Evan You 已提交
7
  description: 'Minimalistic docs generator with Vue component based layout system',
E
Evan You 已提交
8 9 10 11
  dest: 'vuepress',
  base,
  head: [
    ['link', { rel: 'icon', href: `${base}logo.png` }]
12 13
  ],
  themeConfig: {
E
Evan You 已提交
14 15
    logo: `${base}logo.png`,
    repo: 'vuejs/vuepress',
E
Evan You 已提交
16
    // sidebar config
E
Evan You 已提交
17
    sidebar: [
E
Evan You 已提交
18 19
      {
        title: 'Guide',
E
Evan You 已提交
20
        collapsable: false,
E
Evan You 已提交
21
        children: [
E
Evan You 已提交
22
          '/',
E
Evan You 已提交
23 24 25 26
          '/getting-started',
          '/markdown',
          '/assets',
          '/using-vue',
E
Evan You 已提交
27
          '/default-theme',
E
Evan You 已提交
28
          '/custom-themes',
E
Evan You 已提交
29
          '/deploy'
E
Evan You 已提交
30 31 32
        ]
      },
      {
E
Evan You 已提交
33
        title: 'Config Reference',
E
Evan You 已提交
34 35 36 37
        children: extractHeaders(
          path.resolve(__dirname, '../config.md'),
          ['h3']
        ).map(({ title, slug }) => [`/config#${slug}`, title])
E
Evan You 已提交
38
      }
E
Evan You 已提交
39 40 41 42 43 44 45 46 47 48 49 50 51
    ],

    // multi-category sidebar config

    // sidebar: {
    //   '*': [/* ... */],
    //   '/guide/': [/* ... */],
    //   '/tutorial/': [/* ... */],
    //   '/api/': [/* ... */]
    // },

    // navbar config

E
Evan You 已提交
52 53 54 55 56 57 58 59 60 61 62
    nav: [
      {
        text: 'Guide',
        link: '/',
      },
      {
        text: 'Config Reference',
        link: '/config'
      }
      // ...
    ]
63
  }
E
Evan You 已提交
64
}