# Config

# Basic

module.exports = {
  /**
   * base 将会作为前缀自动地插入到所有以 / 开始的其他选项的链接中,所以你只需要指定一次。
   * @type String
   * @default /
   */
  base: '/langnang-temp/',
  /**
   * 网站的标题,它将会被用作所有页面标题的前缀,同时,默认主题下,它将显示在导航栏(navbar)上。
   * @type String
   * @default undefined
   */
  title: 'Langnang Template',
  /**
   * 网站的描述,它将会以 <meta> 标签渲染到当前页面的 HTML 中。
   * @type String
   * @default undefined
   */
  description: 'Welcome',
  /**
   * 额外的需要被注入到当前页面的 HTML <head> 中的标签,每个标签都可以以 [tagName, { attrName: attrValue }, innerHTML?] 的格式指定,
   * @type Array
   * @default []
   */
  head: [
  ],
  /**
   * 指定用于 dev server 的主机名。
   * @type String
   * @default 0.0.0.0
   */
  host: '0.0.0.0',
  /**
   * 指定 dev server 的端口。
   * @type Number
   * @default 8080
   */
  port: 8080,
  /**
   * 插件通常会为 VuePress 添加全局功能。插件的范围没有限制。
   * 你可以在 Awesome VuePress (opens new window)中找到更多的插件。
   * @type Object|Array
   * @default undefined
   */
  plugins: require('./plugins/index.js'),
  /**
   * 主题配置
   */
  ...require('./theme.js'),
  /**
   * Markdown 配置
   */
  markdown: require('./markdown.js'),
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

# Style

// 你应该只在这个文件中定义变量。因为 palette.styl 将在根的 stylus 配置文件的末尾引入,作为配置,它将被多个文件使用,所以一旦你在这里写了样式,你的样式就会被多次复制。

// 颜色
$accentColor = #3eaf7c
$textColor = #2c3e50
$borderColor = #eaecef
$codeBgColor = #282c34
$arrowBgColor = #ccc
$badgeTipColor = #42b983
$badgeWarningColor = darken(#ffe564, 35%)
$badgeErrorColor = #DA5961

// 布局
$navbarHeight = 3.6rem
$sidebarWidth = 20rem
$contentWidth = 740px
$homePageWidth = 960px

// 响应式变化点
$MQNarrow = 959px
$MQMobile = 719px
$MQMobileNarrow = 419px
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

# Theme


module.exports = {
  /**
   * 当你使用自定义主题的时候,需要指定它。
   * @type String
   * @default undefined
   */
  theme: undefined,
  /**
   * 为当前的主题提供一些配置,这些选项依赖于你正在使用的主题。
   * @type Object
   * @default {}
   */
  themeConfig: {
    /**
     * 导航栏
     * @type Boolean
     * @default true
     */
    navbar: true,
    /**
     * 导航栏链接
     */
    nav: [
      { text: 'Home', link: '/' },
      { text: 'Template', link: '/template/' },
      { text: 'Config', link: '/Config/' },
      { text: 'GitHub', link: 'https://github.com/langnang-temp/vuepress' },
      {
        text: 'Vue', items: [
          { text: 'Vue', link: 'https://cn.vuejs.org/zh/' },
          { text: 'Vue Router', link: 'https://router.vuejs.org/zh/' },
          { text: 'Vuex', link: 'https://vuex.vuejs.org/zh/' },
          { text: 'VuePress', link: 'https://vuepress.vuejs.org/zh/' },
          { text: 'Awesome VuePress', link: 'https://github.com/vuepress/awesome-vuepress' },
          { text: 'Vuepress Community', link: 'https://vuepress-community.netlify.app/zh/' },
        ]
      }
    ],
    /**
     * 侧边栏
     * 基本的配置,需要一个包含了多个链接的数组:
     * @type Array | Object
     * @default undefined
     */
    sidebar: 'auto'
  },
  /**
   * 你可以通过 themeConfig.lastUpdated 选项来获取每个文件最后一次 git 提交的 UNIX 时间戳(ms),同时它将以合适的日期格式显示在每一页的底部:
   * @type String|Boolean
   * @default undefined
   */
  lastUpdated: 'Last Updated',
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

# Plugins

module.exports = [
  /**
   * 页面滚动时自动激活侧边栏链接的插件
   */
  ['@vuepress/active-header-links',],
  /**
   * back-to-top 插件
   */
  ['@vuepress/back-to-top',],
  ['@vuepress/blog',],
  /**
   * Google analytics 插件
   */
  ['@vuepress/google-analytics',],
  /**
   * last-updated 插件。
   */
  ['@vuepress/last-updated',],
  ['@vuepress/medium-zoom',],
  /**
   * 一个基于 nprogress (opens new window)的进度条插件
   */
  ['@vuepress/nprogress',],
  /**
   * PWA 插件
   */
  ['@vuepress/pwa',],
  /**
   * 注册组件的插件
   */
  ['@vuepress/register-components',],
  /**
   * 基于 Headers 的搜索插件
   */
  ['@vuepress/search',],
  /**
   * 使你的 VuePress 站点支持简洁链接。
   */
  ['vuepress-plugin-clean-urls',],
  /**
   * 在你的 VuePress 站点中注册新的 Markdown 容器。
   */
  ['vuepress-plugin-container',],
  /**
   * 处理你的 VuePress 站点中的复制操作。
   */
  ['copyright',],
  /**
   * 在你的 VuePress 页面信息中集成 git 日志。
   */
  ['vuepress-plugin-git-log',],
  /**
   * 让你的 VuePress 站点中的 Markdown 文件支持 TeX 语法。
   */
  ['vuepress-plugin-mathjax',],
  /**
   * 从其他网站迁移到 VuePress。
   */
  ['vuepress-plugin-migrate',],
  /**
   * 为你的 VuePress 站点增加目录组件
   */
  ['vuepress-plugin-table-of-contents',],
  /**
   * code-switcher
   */
  ['code-switcher',],
  /**
   *  appends a copy button to every instance of a given selector (defaults to div[class*="language-"] pre)
   */
  ['vuepress-plugin-code-copy',],
  /**
   * Merge Markdown files in a single Markdown
   */
  ['vuepress-plugin-merge-pages',],
  /**
   * Generate dynamic VuePress pages from JSON Schemas.
   */
  ['schema2md', {
    pages: {}
  }],
  /**
   * adding JavaScript charting library Chart.js to VuePress 2 to create interactive charts in Markdown
   */
  ['vuepress-plugin-chart',],
  /**
   * vuepress-plugin-flowchart
   */
  ['flowchart',],
]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89

# Markdown

module.exports = {
  /**
   * 是否在每个代码块的左侧显示行号。
   * @type Boolean
   * @default undefined
   */
  lineNumbers: true,
}
1
2
3
4
5
6
7
Last Updated: 6/22/2022, 3:36:06 AM