Skip to content

Commit 905557c

Browse files
committed
feat: 启用基于 MiniSearch 的本地搜索
1 parent 7d00b85 commit 905557c

1 file changed

Lines changed: 33 additions & 4 deletions

File tree

docs/.vitepress/config.ts

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ const zhThemeConfig = {
88
{ text: '🛠️ 部署教程', link: '/deploy/index' },
99
{ text: '📱 PWA指南', link: '/pwa/' },
1010
{ text: '📥 数据迁移', link: '/data/import' },
11-
{ text: '🧩 浏览器扩展', link: '/extension/architecture' },
12-
{ text: '☁️ 云端备份', link: '/data/backup' }
11+
{ text: '☁️ 云端备份', link: '/data/backup' },
12+
{ text: '🧩 浏览器扩展', link: '/extension/usage' }
1313
],
1414

1515
sidebar: [
@@ -122,8 +122,8 @@ const enThemeConfig = {
122122
{ text: '🛠️ Deployment', link: '/en/deploy/index' },
123123
{ text: '📱 PWA', link: '/en/pwa/' },
124124
{ text: '📥 Migration', link: '/en/data/import' },
125-
{ text: '🧩 Extension', link: '/en/extension/architecture' },
126-
{ text: '☁️ Backup', link: '/en/data/backup' }
125+
{ text: '☁️ Backup', link: '/en/data/backup' },
126+
{ text: '🧩 Extension', link: '/en/extension/usage' }
127127
],
128128
sidebar: [
129129
{
@@ -231,6 +231,35 @@ export default defineConfig({
231231
head: [
232232
['link', { rel: 'icon', href: '/favicon.svg' }]
233233
],
234+
themeConfig: {
235+
search: {
236+
provider: 'local',
237+
options: {
238+
locales: {
239+
root: {
240+
translations: {
241+
button: { buttonText: '搜索文档', buttonAriaLabel: '搜索文档' },
242+
modal: {
243+
noResultsText: '无法找到相关结果',
244+
resetButtonTitle: '清除查询条件',
245+
footer: { selectText: '选择', navigateText: '切换', closeText: '关闭' }
246+
}
247+
}
248+
},
249+
en: {
250+
translations: {
251+
button: { buttonText: 'Search Docs', buttonAriaLabel: 'Search Docs' },
252+
modal: {
253+
noResultsText: 'No results for',
254+
resetButtonTitle: 'Reset search',
255+
footer: { selectText: 'to select', navigateText: 'to navigate', closeText: 'to close' }
256+
}
257+
}
258+
}
259+
}
260+
}
261+
}
262+
},
234263
locales: {
235264
root: {
236265
label: '简体中文',

0 commit comments

Comments
 (0)