Skip to content

Commit 9cd81bc

Browse files
author
JavasHub
committed
update theme
1 parent e1b19cc commit 9cd81bc

File tree

2 files changed

+68
-7
lines changed

2 files changed

+68
-7
lines changed

src/.vuepress/index.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<title>JavasHub</title>
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
7+
</head>
8+
9+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@3"/>
10+
11+
<body>
12+
<div id="app"></div>
13+
</body>
14+
<script type="text/javascript">
15+
docsearch({
16+
appId: "KH7SY7AEUO",
17+
apiKey: "b2a3b223caeed0e8976dcb3f313c5026",
18+
indexName: "imlyk",
19+
insights: true,
20+
container: "div",
21+
debug: false
22+
});
23+
</script>
24+
</html>

src/.vuepress/theme.ts

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,50 @@ export default hopeTheme({
142142

143143
// docsearch 搜索插件选项
144144
docsearch: {
145-
// 必填
146-
apiKey: 'b2a3b223caeed0e8976dcb3f313c5026',
147-
indexName: 'imlyk',
148-
appId: 'KH7SY7AEUO',
149-
150-
// 可选
151-
placeholder: '搜索文档',
145+
appId: "KH7SY7AEUO",
146+
apiKey: "b2a3b223caeed0e8976dcb3f313c5026",
147+
indexName: "imlyk",
148+
locales: {
149+
"/": {
150+
placeholder: "搜索文档",
151+
translations: {
152+
button: {
153+
buttonText: "搜索文档",
154+
buttonAriaLabel: "搜索文档",
155+
},
156+
modal: {
157+
searchBox: {
158+
resetButtonTitle: "清除查询条件",
159+
resetButtonAriaLabel: "清除查询条件",
160+
cancelButtonText: "取消",
161+
cancelButtonAriaLabel: "取消",
162+
},
163+
startScreen: {
164+
recentSearchesTitle: "搜索历史",
165+
noRecentSearchesText: "没有搜索历史",
166+
saveRecentSearchButtonTitle: "保存至搜索历史",
167+
removeRecentSearchButtonTitle: "从搜索历史中移除",
168+
favoriteSearchesTitle: "收藏",
169+
removeFavoriteSearchButtonTitle: "从收藏中移除",
170+
},
171+
errorScreen: {
172+
titleText: "无法获取结果",
173+
helpText: "你可能需要检查你的网络连接",
174+
},
175+
footer: {
176+
selectText: "选择",
177+
navigateText: "切换",
178+
closeText: "关闭",
179+
searchByText: "搜索提供者",
180+
},
181+
noResultsScreen: {
182+
noResultsText: "无法找到相关结果",
183+
suggestedQueryText: "你可以尝试查询",
184+
},
185+
},
186+
},
187+
},
188+
},
152189
},
153190

154191
// 简单一点的搜索

0 commit comments

Comments
 (0)