Skip to content

Commit 24fe00c

Browse files
author
piexlMax(奇淼
committed
feat(文档): 添加中文搜索功能配置
1 parent f6603ec commit 24fe00c

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

docs/.vitepress/config.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,39 @@ export default defineConfig({
4848
themeConfig: {
4949
logo: '/logo.png',
5050

51+
search: {
52+
provider: 'local',
53+
options: {
54+
locales: {
55+
zh: {
56+
translations: {
57+
button: {
58+
buttonText: '搜索文档',
59+
buttonAriaLabel: '搜索文档'
60+
},
61+
modal: {
62+
noResultsText: '无法找到相关结果',
63+
resetButtonTitle: '清除查询条件',
64+
footer: {
65+
selectText: '选择',
66+
navigateText: '切换',
67+
closeText: '关闭'
68+
}
69+
}
70+
}
71+
}
72+
},
73+
miniSearch: {
74+
searchOptions: {
75+
combineWith: 'AND',
76+
fuzzy: 0.2,
77+
prefix: true,
78+
boost: { title: 4, text: 2, titles: 1 }
79+
}
80+
}
81+
}
82+
},
83+
5184
editLink: {
5285
pattern: 'https://github.com/flipped-aurora/gin-vue-admin.com/edit/master/docs/:path',
5386
text: '在Github上编辑此页'

0 commit comments

Comments
 (0)