-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.js
65 lines (64 loc) · 1.72 KB
/
index.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
54
55
56
57
58
59
60
61
62
63
64
65
const path = require('path')
module.exports = (options = {}) => ({
enhanceAppFiles: path.resolve(__dirname, 'enhanceAppFile.js'),
// 根组件设置
extendCli(cli) {
cli
.command(
'new [targetDir] [title]',
'create a new md file, [targetDir] is just like `vuepress dev [docs]` '
)
.option('--tpl <template>', 'use given string to fill out the md yaml ')
.action((targetDir, title, options) => {
const { tpl } = options
require('./lib/new')({ targetDir, title, tpl })
})
},
markdown: {
extendMarkdown: (md) => {
// 使用更多的 markdown-it 插件!
md.use(require('markdown-it-katex'))
}
},
plugins: [
[
'@vuepress/blog',
{
sitemap: options.hostname && {
hostname: options.hostname
},
comment: options.comment && {
service: 'vssue',
platform: 'github',
owner: options.comment.owner,
// 用于存储 issue 和评论的存储库的名称。
repo: options.comment.repo,
// 从 OAuth2 规范中引入的 clientId 和 clientSecret。
clientId: options.comment.clientId,
clientSecret: options.comment.clientSecret
},
directories: [
{
id: 'post',
dirname: '_post',
path: '/',
itemPermalink: '/:slug',
pagination: {
lengthPerPage: 10
}
}
]
}
],
'@vuepress/plugin-nprogress',
'@vuepress/back-to-top',
['@vuepress/medium-zoom', { selector: '.page img' }],
['smooth-scroll', true],
[
'@vuepress/google-analytics',
{
ga: options.ga || ''
}
]
]
})