-
Notifications
You must be signed in to change notification settings - Fork 12
/
index.js
121 lines (119 loc) · 3.03 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
const path = require('path')
module.exports = (options, {themeConfig}) => {
/**
* Default theme configuration
*/
themeConfig = Object.assign(themeConfig, {
searchPlaceholder: themeConfig.searchPlaceholder || 'Search',
nav: themeConfig.nav || [
{ text: '🏠 Home', link: '/' }
],
hostname: themeConfig.hostname || '',
wordPerminute: themeConfig.wordPerminute || {cn: 300, en: 160},
social: themeConfig.social || [],
reward: themeConfig.reward || {},
dateFormat: themeConfig.dateFormat || 'MMM DD, YYYY'
})
const plugins = [
['@vuepress/nprogress'],
['@vuepress/search'],
['flowchart'],
['vuepress-plugin-container', {
type: 'tip',
defaultTitle: {
'/': 'TIP',
'/zh/': '提示'
}
}],
['vuepress-plugin-container', {
type: 'warning',
defaultTitle: {
'/': 'WARNING',
'/zh/': '注意'
}
}],
['vuepress-plugin-container', {
type: 'danger',
defaultTitle: {
'/': 'WARNING',
'/zh/': '警告'
}
}],
['vuepress-plugin-container', {
type: 'details',
before: info => `<details class="custom-block details">${info ? `<summary>${info}</summary>` : ''}\n`,
after: () => '</details>\n'
}],
['vuepress-plugin-container', {
type: 'demo',
before: () => `<DemoCode>\n`,
after: () => '</DemoCode>\n'
}],
['@vuepress/medium-zoom', {
selector: '.article-content img',
// medium-zoom options here
// See: https://github.com/francoischalifour/medium-zoom#options
options: {
margin: 16,
background: "#FF0000",
}
}],
['@vuepress/blog', themeConfig.blog || {
directories: [
{
id: 'post',
dirname: '_post',
path: '/',
itemPermalink: '/post/:year/:month/:day/:slug.html',
pagination: {
perPagePosts: 10,
prevText: '',
nextText: ''
}
}
],
frontmatters: [
{
id: "tag",
keys: ['tag', 'tags'],
path: '/tags/',
frontmatter: { title: 'Tag' },
pagination: {
lengthPerPage: 10,
prevText: '',
nextText: ''
}
},
{
id: "category",
keys: ['category', 'categories'],
path: '/categories/',
frontmatter: { title: 'Category' },
pagination: {
lengthPerPage: 10,
prevText: '',
nextText: ''
}
}
]
}],
[
'vuepress-plugin-seo', themeConfig.seo || false
],
['@vuepress/pwa', themeConfig.pwa || false],
['one-click-copy', themeConfig.copy || false],
require('./plugin/demo-code'),
require('./plugin/theme-utils'),
require('./plugin/float-menu')
];
if(themeConfig.palette) {
plugins.push(require('./plugin/theme-palette'));
}
const config = {
plugins,
alias: {
assets: path.resolve(__dirname, 'assets'),
}
}
return config
}