From 8eca5e2c22d52f5aea7dfe76d651ff69b7a2c181 Mon Sep 17 00:00:00 2001 From: snowykami Date: Sat, 31 Aug 2024 07:54:41 +0800 Subject: [PATCH] =?UTF-8?q?:fire:=20=E6=96=B0=E5=A2=9E=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/.vitepress/config/common.ts | 75 +++++++++++++++++++++++++++++++- docs/.vitepress/config/en.ts | 2 +- docs/.vitepress/config/ja.ts | 2 +- docs/.vitepress/config/zh.ts | 2 +- 4 files changed, 77 insertions(+), 4 deletions(-) diff --git a/docs/.vitepress/config/common.ts b/docs/.vitepress/config/common.ts index 9e6dec9..21e7343 100644 --- a/docs/.vitepress/config/common.ts +++ b/docs/.vitepress/config/common.ts @@ -1,3 +1,5 @@ +// 共有配置项,导入index用 + import {defineConfig} from 'vitepress' import {generateSidebar} from 'vitepress-sidebar'; import {zh} from "./zh"; @@ -71,11 +73,82 @@ export const common = defineConfig({ socialLinks: [ {icon: 'github', link: 'https://github.com/snowykami/mbcp'} ], - outline: [2, 6] + search: { + provider: 'local', + options: { + locales: { + root: { + translations: { + button: { + buttonText: '搜索文档', + buttonAriaLabel: '打开搜索框', + }, + modal: { + noResultsText: '没有找到搜索结果', + resetButtonTitle: '清除查询条件', + footer: { + selectText: '选择', + navigateText: '切换', + } + } + }, + }, + en: { + translations: { + button: { + buttonText: 'Search', + buttonAriaLabel: 'Search', + }, + modal: { + noResultsText: 'No results found', + resetButtonTitle: 'Reset search query', + footer: { + selectText: 'Select', + navigateText: 'Navigate', + } + } + } + }, + zht: { + translations: { + button: { + buttonText: '搜索文檔', + buttonAriaLabel: '打開搜索框', + }, + modal: { + noResultsText: '沒有找到搜索結果', + resetButtonTitle: '清除查詢條件', + footer: { + selectText: '選擇', + navigateText: '切換', + } + } + } + }, + ja: { + translations: { + button: { + buttonText: '検索', + buttonAriaLabel: '検索を開く', + }, + modal: { + noResultsText: '検索結果が見つかりません', + resetButtonTitle: 'リセット', + footer: { + selectText: '選択', + navigateText: '移動', + } + } + } + } + } + } + } }, sitemap: { hostname: 'https://mbcp.sfkm.me' }, + lastUpdated: true, locales: { root: {label: "简体中文", ...zh}, en: {label: "English", ...en}, diff --git a/docs/.vitepress/config/en.ts b/docs/.vitepress/config/en.ts index 52a1bf9..d186691 100644 --- a/docs/.vitepress/config/en.ts +++ b/docs/.vitepress/config/en.ts @@ -23,6 +23,6 @@ export const en = defineConfig({ message: 'Documentation built with VitePress | API references generated by litedoc', copyright: ThemeConfig.copyright }, - outline: ThemeConfig.getOutLine("Page Content") + outline: ThemeConfig.getOutLine("Page Content"), }, }) \ No newline at end of file diff --git a/docs/.vitepress/config/ja.ts b/docs/.vitepress/config/ja.ts index bb0a0a7..db7167b 100644 --- a/docs/.vitepress/config/ja.ts +++ b/docs/.vitepress/config/ja.ts @@ -23,6 +23,6 @@ export const ja = defineConfig({ message: 'VitePress で構築されたドキュメント | litedoc によって生成されたAPIリファレンス', copyright: ThemeConfig.copyright }, - outline: ThemeConfig.getOutLine("ページの内容") + outline: ThemeConfig.getOutLine("ページの内容"), }, }) \ No newline at end of file diff --git a/docs/.vitepress/config/zh.ts b/docs/.vitepress/config/zh.ts index 38a2fd3..1e9ddd7 100644 --- a/docs/.vitepress/config/zh.ts +++ b/docs/.vitepress/config/zh.ts @@ -23,6 +23,6 @@ export const zh = defineConfig({ message: '文档由 VitePress 构建 | API引用由 litedoc 生成', copyright: ThemeConfig.copyright }, - outline: ThemeConfig.getOutLine("页面内容") + outline: ThemeConfig.getOutLine("页面内容"), }, }) \ No newline at end of file