Skip to content

Commit

Permalink
feat: 添加文档搜索功能 (#24)
Browse files Browse the repository at this point in the history
* feat: 添加文档的本地搜索功能

* feat: 移除文档的本地搜索并添加 algolia 搜索
  • Loading branch information
liunnn1994 authored Jun 5, 2023
1 parent 59f7e9c commit 9248fb6
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
auto-install-peers=true
registry = https://registry.npmmirror.com
registry=https://registry.npmmirror.com
54 changes: 53 additions & 1 deletion docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { defineConfig } from "vitepress";

// https://vitepress.dev/reference/site-config

export default defineConfig({
title: "common-utils 文档",
description: "common-utils 文档",
Expand Down Expand Up @@ -39,6 +40,57 @@ export default defineConfig({
},
],

socialLinks: [{ icon: "github", link: "https://github.com/vuejs/vitepress" }],
socialLinks: [{ icon: "github", link: "https://github.com/NI-Web-Infra-Team/common-utils" }],
search: {
provider: "algolia",
options: {
appId: "Z2YBW0M2IK",
apiKey: "b01ae98fd95144d1b8c58a0fc4db5c04",
indexName: "common-utils-js",
locales: {
zh: {
placeholder: "搜索文档",
translations: {
button: {
buttonText: "搜索文档",
buttonAriaLabel: "搜索文档",
},
modal: {
searchBox: {
resetButtonTitle: "清除查询条件",
resetButtonAriaLabel: "清除查询条件",
cancelButtonText: "取消",
cancelButtonAriaLabel: "取消",
},
startScreen: {
recentSearchesTitle: "搜索历史",
noRecentSearchesText: "没有搜索历史",
saveRecentSearchButtonTitle: "保存至搜索历史",
removeRecentSearchButtonTitle: "从搜索历史中移除",
favoriteSearchesTitle: "收藏",
removeFavoriteSearchButtonTitle: "从收藏中移除",
},
errorScreen: {
titleText: "无法获取结果",
helpText: "你可能需要检查你的网络连接",
},
footer: {
selectText: "选择",
navigateText: "切换",
closeText: "关闭",
searchByText: "搜索提供者",
},
noResultsScreen: {
noResultsText: "无法找到相关结果",
suggestedQueryText: "你可以尝试查询",
reportMissingResultsText: "你认为该查询应该有结果?",
reportMissingResultsLinkText: "点击反馈",
},
},
},
},
},
},
},
},
});

0 comments on commit 9248fb6

Please sign in to comment.