From 9b54e51d9bf80ed53947737c42b9644c223ffafe Mon Sep 17 00:00:00 2001 From: Meow <197331664+Meo597@users.noreply.github.com> Date: Wed, 17 Dec 2025 05:49:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vitepress/config.mts | 75 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/.vitepress/config.mts b/.vitepress/config.mts index e8a9817a..ee848422 100644 --- a/.vitepress/config.mts +++ b/.vitepress/config.mts @@ -17,6 +17,35 @@ export default defineConfig({ { text: "开发指南", link: "/development/" }, ], + search: { + provider: "local", + options: { + miniSearch: { + options: { + tokenize: (str) => str.split(/[\s,,。、]+/), + }, + }, + locales: { + root: { + translations: { + button: { + buttonText: "搜索", + buttonAriaLabel: "搜索", + }, + modal: { + noResultsText: "无法找到相关结果", + resetButtonTitle: "清除查询条件", + footer: { + selectText: "选择", + navigateText: "切换", + }, + }, + }, + }, + }, + }, + }, + outline: { level: [2, 4], label: "页面导航", @@ -268,7 +297,7 @@ export default defineConfig({ locales: { root: { label: "简体中文", - lang: "cn", + lang: "zh", }, en: { @@ -283,6 +312,19 @@ export default defineConfig({ { text: "Developer Guide", link: "/en/development/" }, ], + search: { + options: { + miniSearch: { + options: { + tokenize: (str) => + str + .split(/[\s.,;!?'"(){}[\]\-_+=&%$#@~`^<>|\\]+/) + .filter(Boolean), + }, + }, + }, + }, + outline: { label: "On this page", }, @@ -617,6 +659,37 @@ export default defineConfig({ { text: "Руководство разработчика", link: "/ru/development/" }, ], + search: { + options: { + miniSearch: { + options: { + tokenize: (str) => + str + .split(/[\s.,;!?'"(){}[\]\-_+=&%$#@~`^<>|\\]+/) + .filter(Boolean), + }, + }, + locales: { + ru: { + translations: { + button: { + buttonText: "Поиск", + buttonAriaLabel: "Поиск", + }, + modal: { + noResultsText: "Результаты не найдены", + resetButtonTitle: "Очистить запрос", + footer: { + selectText: "Выбрать", + navigateText: "Переключить", + }, + }, + }, + }, + }, + }, + }, + outline: { label: "Содержание страницы", },