Skip to content

Commit

Permalink
add local search feature
Browse files Browse the repository at this point in the history
  • Loading branch information
LightYourJourney committed Sep 6, 2024
1 parent bd78af5 commit c718969
Showing 1 changed file with 45 additions and 2 deletions.
47 changes: 45 additions & 2 deletions docs/.vitepress/config/theme.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,50 @@
import type { DefaultTheme } from "vitepress/theme-without-fonts";
import algolia from "./algolia";
import { LOGO as logo, REPO } from "./info";
import nav from "./nav";
import sidebar from "./sidebar";

const themeConfig: DefaultTheme.Config = {
algolia,
// algolia,
search: {
provider: "local",
options: {
locales: {
root: {
translations: {
button: {
buttonText: "搜索",
buttonAriaLabel: "搜索",
},
modal: {
displayDetails: "显示详细列表",
resetButtonTitle: "重置搜索",
backButtonTitle: "关闭搜索",
noResultsText: "没有结果",
footer: {
selectText: "选择",
selectKeyAriaLabel: "输入",
navigateText: "导航",
navigateUpKeyAriaLabel: "上箭头",
navigateDownKeyAriaLabel: "下箭头",
closeText: "关闭",
closeKeyAriaLabel: "esc",
},
},
},
},
},
},
},
darkModeSwitchLabel: "颜色选择",
lightModeSwitchTitle: "切换至亮色模式",
darkModeSwitchTitle: "切换至暗色模式",
sidebarMenuLabel: "目录",
returnToTopLabel: "回到顶部",
externalLinkIcon: true,
outline: {
label: "目录",
level: [1, 5],
},
editLink: {
pattern: `${REPO}/edit/main/docs/:path`,
text: "在 GitHub 上编辑此页",
Expand All @@ -15,6 +54,10 @@ const themeConfig: DefaultTheme.Config = {
'Availably free under <a href="https://creativecommons.org/licenses/by-sa/4.0/deed.zh" class="grabient-text">CC BY-SA 4.0</a>.',
copyright: `Made with ❤️️ by <a href="${REPO}/graphs/contributors" class="grabient-text">all contributors</a>.`,
},
docFooter: {
prev: "上一节",
next: "下一节",
},
lastUpdatedText: "📑 最后更新",
logo,
nav,
Expand Down

0 comments on commit c718969

Please sign in to comment.