File tree Expand file tree Collapse file tree 2 files changed +29
-16
lines changed
Expand file tree Collapse file tree 2 files changed +29
-16
lines changed Original file line number Diff line number Diff line change 11import type { ThemeLocaleData } from 'vuepress-theme-hope'
2+ import type { SearchProLocaleData } from 'vuepress-plugin-search-pro'
23import { NotFoundMsgList } from './constant'
34
45/**
56 * 支持中文
67 * 参考:https://theme-hope.vuejs.press/zh/config/i18n.html
78 */
8- const localCN : ThemeLocaleData = {
9+ const themeLocalCN : ThemeLocaleData = {
910 lang : 'zh-CN' ,
1011 navbarLocales : {
1112 langName : '简体中文' ,
@@ -76,5 +77,26 @@ const localCN: ThemeLocaleData = {
7677 * 自定义语言,支持文案
7778 */
7879export const i18n = {
79- '/' : localCN ,
80+ '/' : themeLocalCN ,
81+ }
82+
83+ /**
84+ * 搜索框支持中文
85+ * 参考:https://plugin-search-pro.vuejs.press/zh/config.html#locales
86+ */
87+ export const searchProCNLocals : SearchProLocaleData = {
88+ placeholder : '请输入需要搜索的关键字' ,
89+ search : '搜索文档' ,
90+ searching : '搜索中' ,
91+ cancel : '取消' ,
92+ select : '选择' ,
93+ navigate : '切换' ,
94+ exit : '关闭' ,
95+ loading : '正在努力搜索中...' ,
96+ queryHistory : '搜素文字历史' ,
97+ resultHistory : '搜索结果' ,
98+ emptyHistory : '没有搜索历史' ,
99+ emptyResult : '无法找到相关结果' ,
100+ defaultTitle : '搜索文档' ,
101+ autocomplete : '自动补齐' ,
80102}
Original file line number Diff line number Diff line change 11import { hopeTheme } from 'vuepress-theme-hope'
22import { AUTHOR_INFO , COPYRIGHT , FOOTER_HTML_INFO } from './constant'
3- import { i18n } from './i18n'
3+ import { i18n , searchProCNLocals } from './i18n'
44import navbar from './navbar'
55import sidebar from './sidebar'
66
@@ -159,19 +159,10 @@ export const themeConfig = {
159159 } ,
160160 } ,
161161 searchPro : {
162- // 索引全部内容
163- indexContent : true ,
164- // 为分类和标签添加索引
165- customFields : [
166- {
167- getter : ( page : any ) => page . frontmatter . category ,
168- formatter : '分类:$content' ,
169- } ,
170- {
171- getter : page => page . frontmatter . tag ,
172- formatter : '标签:$content' ,
173- } ,
174- ] ,
162+ // 参考:https://plugin-search-pro.vuejs.press/zh/config.html#locales
163+ locales : {
164+ '/' : searchProCNLocals ,
165+ } ,
175166 } ,
176167 // 代码高亮:https://theme-hope.vuejs.press/zh/guide/feature/code-block.html
177168 shiki : {
You can’t perform that action at this time.
0 commit comments