This repository has been archived by the owner on Jan 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
96 lines (94 loc) · 2.3 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
const path = require('path')
// Theme API.
module.exports = (options, ctx) => ({
alias () {
const { themeConfig, siteConfig } = ctx
// resolve algolia
const isAlgoliaSearch = (
themeConfig.algolia ||
Object.keys(siteConfig.locales && themeConfig.locales || {})
.some(base => themeConfig.locales[base].algolia)
)
return {
'@AlgoliaSearchBox': isAlgoliaSearch
? path.resolve(__dirname, 'components/AlgoliaSearchBox.vue')
: path.resolve(__dirname, 'noopModule.js'),
'@SearchBox': path.resolve(__dirname, 'components/SearchBox.vue')
}
},
plugins: [
'@vuepress-reco/back-to-top',
'@vuepress-reco/pagation',
'@vuepress-reco/comments',
'@vuepress/active-header-links',
['@vuepress/medium-zoom', {
selector: '.theme-reco-content :not(a) > img'
}],
'@vuepress/plugin-nprogress',
['@vuepress/plugin-blog', {
permalink: '/:regular',
frontmatters: [
{
id: 'tags',
keys: ['tags'],
path: '/tag/',
layout: 'tag',
scopeLayout: 'Tag'
},
{
id: 'categories',
keys: ['categories'],
path: '/categories/',
layout: 'category',
scopeLayout: 'Category'
},
{
id: 'timeline',
keys: ['timeline'],
path: '/timeline/',
layout: 'TimeLines',
scopeLayout: 'TimeLine'
}
]
}],
['container', {
type: 'tip',
defaultTitle: {
'/': '',
'/zh/': '提示'
}
}],
['container', {
type: 'warning',
defaultTitle: {
'/': '',
'/zh/': '注意'
}
}],
['container', {
type: 'danger',
defaultTitle: {
'/': '',
'/zh/': '警告'
}
}],
['container', {
type: 'right',
defaultTitle: ''
}],
['container', {
type: 'theorem',
before: info => `<div class="custom-block theorem"><p class="title">${info}</p>`,
after: '</div>'
}],
['container', {
type: 'details',
before: info => `<details class="custom-block details">${info ? `<summary>${info}</summary>` : ''}\n`,
after: () => '</details>\n',
defaultTitle: {
'/': 'See More',
'/zh/': '更多'
}
}]
]
})