forked from vuejs/rollup-plugin-vue
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfig.js
58 lines (50 loc) · 1.32 KB
/
config.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
const languages = {
title: 'Language',
type: 'dropdown',
exact: true,
items: [{ title: 'English', path: '/en/', matchPath: /\/en\/.*/i }]
}
const home = { title: 'Home', path: '/' }
const versions = [
{ title: 'Version 2.2', path: '/2.2/', matchPath: /^\/([a-z-]+)\/2.2\/.*/i },
{ title: 'Version 2.3', path: '/2.3/', matchPath: /^\/([a-z-]+)\/2.3\/.*/i }
]
function lang_version(lang) {
const version = {
title: 'Version',
type: 'dropdown',
exact: true
}
version.items = versions.map(function(v) {
const ver = Object.assign({}, v)
ver.path = '/' + lang + ver.path
return ver
})
return version
}
docute.init({
repo: 'vuejs/rollup-plugin-vue',
'edit-link': 'https://github.com/vuejs/rollup-plugin-vue/edit/master/docs',
nav: {
default: [home, languages, lang_version('en')],
'en2.3': [
{ title: 'Home', path: '/en/2.3/' },
{ title: 'Examples', path: '/en/2.3/examples' },
languages,
lang_version('en')
],
'en2.2': [
{ title: 'Home', path: '/en/2.2/' },
{ title: 'Examples', path: '/en/2.2/examples' },
languages,
lang_version('en')
]
},
plugins: [
docsearch({
apiKey: '7792597613e997afeb0b75a206ca0c5a',
indexName: 'rollup-plugin-vue',
url: 'https://vuejs.github.io/rollup-plugin-vue'
})
]
})