Skip to content

Commit 20b65bb

Browse files
committed
fix: search plugin
1 parent 54d43b3 commit 20b65bb

File tree

1 file changed

+26
-7
lines changed

1 file changed

+26
-7
lines changed

docs/.vitepress/config.mts

+26-7
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,13 @@ export default defineConfig({
77
locales: {
88
root: {
99
label: '简体中文',
10-
lang: 'cn',
10+
lang: 'zh',
1111
themeConfig: {
1212
// https://vitepress.dev/reference/default-theme-config
1313
nav: [
1414
{ text: '主页', link: '/' },
1515
{ text: '介绍', link: '/intro' }
1616
],
17-
search: {
18-
provider: 'local'
19-
},
2017
logo: '/favicon-32x32.png',
2118
footer: {
2219
message: 'Released under the CC-BY-SA-4.0 license.',
@@ -36,9 +33,6 @@ export default defineConfig({
3633
{ text: 'Home', link: '/en' },
3734
{ text: 'Introduction', link: '/en/intro' }
3835
],
39-
search: {
40-
provider: 'local'
41-
},
4236
logo: '/favicon-32x32.png',
4337
footer: {
4438
message: 'Released under the CC-BY-SA-4.0 license.',
@@ -50,6 +44,31 @@ export default defineConfig({
5044
}
5145
}
5246
},
47+
themeConfig: {
48+
search: {
49+
provider: 'local',
50+
options: {
51+
locales: {
52+
zh: {
53+
translations: {
54+
button: {
55+
buttonText: '搜索文档',
56+
buttonAriaLabel: '搜索文档'
57+
},
58+
modal: {
59+
noResultsText: '无法找到相关结果',
60+
resetButtonTitle: '清除查询条件',
61+
footer: {
62+
selectText: '选择',
63+
navigateText: '切换'
64+
}
65+
}
66+
}
67+
}
68+
}
69+
}
70+
}
71+
},
5372
head: [
5473
['link', { rel: 'icon', type: 'image/png', href: '/favicon-32x32.png' }],
5574
[

0 commit comments

Comments
 (0)