Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

Commit 04722c1

Browse files
committed
Use latest version of docute
1 parent bf6d8ad commit 04722c1

File tree

4 files changed

+51
-21
lines changed

4 files changed

+51
-21
lines changed

docs/config.js

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,50 @@
1-
function plugin() {
2-
return (ctx) => {
3-
window.app = ctx
4-
}
5-
}
6-
71
const languages = {
82
title: 'Language',
93
type: 'dropdown',
104
exact: true,
115
items: [
12-
{ title: 'English', path: '/en/' }
6+
{ title: 'English', path: '/en/', matchPath: /\/en\/.*/i }
137
]
148
}
159

1610
const home = { title: 'Home', path: '/' }
1711

18-
const version_en = {
19-
title: 'Version',
20-
type: 'dropdown',
21-
exact: true,
22-
items: [
23-
{ title: 'Version 2.2', path: '/en/2.2/' },
24-
{ title: 'Version 2.3', path: '/en/2.3/' },
25-
]
12+
const versions = [
13+
{ title: 'Version 2.2', path: '/2.2/', matchPath: /^\/([a-z-]+)\/2.2\/.*/i },
14+
{ title: 'Version 2.3', path: '/2.3/', matchPath: /^\/([a-z-]+)\/2.3\/.*/i },
15+
]
16+
17+
function lang_version(lang) {
18+
const version = {
19+
title: 'Version',
20+
type: 'dropdown',
21+
exact: true,
22+
}
23+
version.items = versions.map(function (v) {
24+
const ver = Object.assign({}, v)
25+
ver.path = '/' + lang + ver.path
26+
27+
return ver
28+
})
29+
30+
return version
2631
}
2732

2833
self.$config = {
2934
repo: 'vuejs/rollup-plugin-vue',
3035
'edit-link': 'https://github.com/vuejs/rollup-plugin-vue/edit/master/docs',
3136

3237
nav: {
33-
default: [home, languages, version_en],
34-
35-
'en2.2': [home, { title: 'Examples', path: '/en/2.2/examples' }, languages, version_en]
38+
default: [home, languages, lang_version('en')],
39+
'en2.3': [{ title: 'Home', path: '/en/2.3/' }, { title: 'Examples', path: '/en/2.3/examples' }, languages, lang_version('en')],
40+
'en2.2': [{ title: 'Home', path: '/en/2.2/' }, { title: 'Examples', path: '/en/2.2/examples' }, languages, lang_version('en')],
3641
},
3742

38-
plugins: [plugin()]
43+
plugins: [
44+
docsearch({
45+
apiKey: 'You API Key',
46+
indexName: 'rollup-plugin-vue-docs',
47+
tags: ['en']
48+
})
49+
]
3950
}

docs/en/2.3/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
---
2+
nav: en2.3
3+
4+
---
5+
16
## Installation
27
[Node][node] and [Rollup][rollup] are required to use rollup-plugin-vue. Use [NPM][NPM] or [yarn][yarn] to add `rollup-plugin-vue` as development dependency to your project.
38

@@ -106,6 +111,9 @@ export default {
106111
}
107112
```
108113

114+
#### CSS Modules
115+
116+
109117
### Template
110118

111119
#### Template Languages

docs/en/2.3/examples.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
nav: en2.3
3+
4+
---
5+
6+
## Examples
7+
8+
> WIP
9+

docs/index.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
66
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
77
<title>Rollup Plugin for Vue</title>
8-
<link rel="stylesheet" href="https://unpkg.com/docute@2.5.0/dist/docute.css">
8+
<link rel="icon" href="https://vuejs.org/images/logo.png" type="image/x-icon">
9+
<link rel="stylesheet" href="https://unpkg.com/docute@2.7.2/dist/docute.css">
910
</head>
1011
<body>
1112
<!-- don't remove this part start -->
1213
<div id="app"></div>
14+
<script src="https://unpkg.com/docute/plugins/docsearch.js"></script>
1315
<script src="./config.js"></script>
14-
<script src="https://unpkg.com/docute@2.5.0/dist/docute.js"></script>
16+
<script src="https://unpkg.com/docute/dist/docute.js"></script>
1517
<!-- don't remove this part end -->
1618
</body>
1719
</html>

0 commit comments

Comments
 (0)