Skip to content

Commit 5161349

Browse files
authored
add: docsearch plugin (#77)
* add: docsearch * fix: plugin-docsearch version * remove: additional build commnad * remove: process env * remove: vuepress version * test version: @vuepress/plugin-docsearch 2.0.0-rc.31 * test version: node 20.14.0 * fix indexName * test new bundler version
1 parent 0a9ccd4 commit 5161349

File tree

7 files changed

+34
-24
lines changed

7 files changed

+34
-24
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ package-lock.json
44
.cache/
55
.temp/
66
.idea
7-
.vscode
7+
.vscode
8+
.env

.npmignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ dist
1111
config.local.js
1212
basement_dist
1313
.cache
14-
.temp
14+
.temp
15+
.env

netlify.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[build]
2-
environment = { NODE_VERSION = '18.20.3' }
2+
environment = { NODE_VERSION = '20.14.0' }

package.json

+6-9
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,16 @@
66
"author": "WWebJS Contributors",
77
"scripts": {
88
"docs:dev": "vuepress dev src",
9-
"docs:build": "vuepress build src",
10-
"guide:dev": "vuepress dev src",
11-
"guide:build": "vuepress build src"
9+
"docs:build": "vuepress build src"
1210
},
1311
"homepage": "https://wwebjs.dev",
1412
"license": "MIT",
1513
"devDependencies": {
16-
"@vuepress/bundler-vite": "2.0.0-rc.12",
17-
"@vuepress/plugin-search": "2.0.0-rc.33",
18-
"@vuepress/theme-default": "2.0.0-rc.33",
19-
"vuepress": "2.0.0-rc.12"
14+
"@vuepress/bundler-vite": "2.0.0-rc.14",
15+
"@vuepress/plugin-docsearch": "2.0.0-rc.37",
16+
"@vuepress/theme-default": "2.0.0-rc.37"
2017
},
2118
"engines": {
22-
"node": ">=18.20.3"
19+
"node": ">=20.14.0"
2320
}
24-
}
21+
}

src/.vuepress/config.js

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { viteBundler } from '@vuepress/bundler-vite'
2-
import { searchPlugin } from '@vuepress/plugin-search'
32
import { defaultTheme } from '@vuepress/theme-default'
43
import { defineUserConfig } from 'vuepress'
5-
import { head, navbar, sidebar } from './config/index.js'
4+
import { head, navbar, sidebar, plugins } from './config/index.js'
65

76
export default defineUserConfig({
87
head,
@@ -30,13 +29,5 @@ export default defineUserConfig({
3029
}
3130
},
3231
}),
33-
plugins: [
34-
searchPlugin({
35-
locales: {
36-
'/': {
37-
placeholder: 'Search'
38-
}
39-
},
40-
}),
41-
],
32+
plugins: plugins
4233
})

src/.vuepress/config/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export * from './head.js'
22
export * from './sidebar.js'
3-
export * from './navbar.js'
3+
export * from './navbar.js'
4+
export * from './plugins.js'

src/.vuepress/config/plugins.js

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { docsearchPlugin } from '@vuepress/plugin-docsearch'
2+
3+
export const plugins = [
4+
docsearchPlugin({
5+
appId: '8AJ0E0DA1M',
6+
apiKey: 'fcc76d2a115c516c8d01512303f43a8b',
7+
indexName: 'wwebjs',
8+
locales: {
9+
'/': {
10+
placeholder: 'Search',
11+
translations: {
12+
button: {
13+
buttonText: 'Search'
14+
}
15+
}
16+
}
17+
}
18+
})
19+
];

0 commit comments

Comments
 (0)