Skip to content
This repository was archived by the owner on Jul 20, 2023. It is now read-only.

Commit c47db6d

Browse files
authored
refactor(search): use official search feature (#155)
1 parent c7ed194 commit c47db6d

File tree

3 files changed

+3
-46
lines changed

3 files changed

+3
-46
lines changed

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
"dependencies": {
2525
"@types/markdown-it": "*",
2626
"@types/prismjs": "*",
27-
"flexsearch": "^0.7.31",
2827
"@vue/theme": "2.2.1",
2928
"@vueuse/core": "10.0.2",
3029
"@vueuse/head": "1.1.23",
@@ -33,7 +32,6 @@
3332
"prismjs": "^1.29.0",
3433
"segment": "^0.1.3",
3534
"shiki": "0.14.1",
36-
"vitepress-plugin-search": "1.0.4-alpha.20",
3735
"vite": "4.2.1",
3836
"vitepress": "1.0.0-alpha.69",
3937
"vue": "3.2.47"

pnpm-lock.yaml

Lines changed: 0 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/.vitepress/config.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
import { join, resolve } from 'path'
44
import Windicss from 'vite-plugin-windicss'
55
import { UserConfig } from 'vitepress'
6-
import { SearchPlugin } from "vitepress-plugin-search";
7-
import flexSearchIndexOptions from "flexsearch";
86
import navBar, {
9-
deployBar,
107
deploySideBar,
118
devBar,
129
experimentBar,
@@ -85,6 +82,9 @@ const config: UserConfig = {
8582
scrollOffset: 'header',
8683

8784
themeConfig: {
85+
search: {
86+
provider: "local"
87+
},
8888
logo: '/logo.png',
8989
editLink: {
9090
// repo: 'mx-space/docs',
@@ -137,12 +137,6 @@ const config: UserConfig = {
137137
},
138138
plugins: [
139139
// NavbarFix(),
140-
SearchPlugin({
141-
...flexSearchIndexOptions,
142-
tokenize: 'full',
143-
buttonLabel: '搜索',
144-
placeholder: '搜索文档',
145-
}),
146140
Windicss({
147141
config: join(__dirname, '../../windi.config.ts'),
148142
}),

0 commit comments

Comments
 (0)