1- import { defineAdditionalConfig } from 'vitepress'
1+ import { type DefaultTheme , defineAdditionalConfig } from 'vitepress'
2+ import pkg from '../../packages/create-mcp-kit/package.json' with { type : 'json' }
23
34// https://vitepress.dev/reference/site-config
45export default defineAdditionalConfig ( {
@@ -8,7 +9,7 @@ export default defineAdditionalConfig({
89 { text : '首页' , link : '/zh/' } ,
910 { text : '指南' , link : '/zh/guide/what-is-mcp' , activeMatch : '/guide/' } ,
1011 {
11- text : '0.0.8' ,
12+ text : pkg . version ,
1213 items : [
1314 {
1415 text : 'Changelog' ,
@@ -28,5 +29,84 @@ export default defineAdditionalConfig({
2829 ] ,
2930 } ,
3031 ] ,
32+
33+ search : { options : searchOptions ( ) } ,
3134 } ,
3235} )
36+
37+
38+ function searchOptions ( ) : Partial < DefaultTheme . AlgoliaSearchOptions > {
39+ return {
40+ placeholder : '搜索文档' ,
41+ translations : {
42+ button : {
43+ buttonText : '搜索文档' ,
44+ buttonAriaLabel : '搜索文档' ,
45+ } ,
46+ modal : {
47+ searchBox : {
48+ clearButtonTitle : '清除查询条件' ,
49+ clearButtonAriaLabel : '清除查询条件' ,
50+ closeButtonText : '关闭' ,
51+ closeButtonAriaLabel : '关闭' ,
52+ placeholderText : '搜索文档' ,
53+ placeholderTextAskAi : '向 AI 提问:' ,
54+ placeholderTextAskAiStreaming : '回答中...' ,
55+ searchInputLabel : '搜索' ,
56+ backToKeywordSearchButtonText : '返回关键字搜索' ,
57+ backToKeywordSearchButtonAriaLabel : '返回关键字搜索' ,
58+ } ,
59+ startScreen : {
60+ recentSearchesTitle : '搜索历史' ,
61+ noRecentSearchesText : '没有搜索历史' ,
62+ saveRecentSearchButtonTitle : '保存至搜索历史' ,
63+ removeRecentSearchButtonTitle : '从搜索历史中移除' ,
64+ favoriteSearchesTitle : '收藏' ,
65+ removeFavoriteSearchButtonTitle : '从收藏中移除' ,
66+ recentConversationsTitle : '最近的对话' ,
67+ removeRecentConversationButtonTitle : '从历史记录中删除对话' ,
68+ } ,
69+ errorScreen : {
70+ titleText : '无法获取结果' ,
71+ helpText : '你可能需要检查你的网络连接' ,
72+ } ,
73+ noResultsScreen : {
74+ noResultsText : '无法找到相关结果' ,
75+ suggestedQueryText : '你可以尝试查询' ,
76+ reportMissingResultsText : '你认为该查询应该有结果?' ,
77+ reportMissingResultsLinkText : '点击反馈' ,
78+ } ,
79+ resultsScreen : {
80+ askAiPlaceholder : '向 AI 提问: ' ,
81+ } ,
82+ askAiScreen : {
83+ disclaimerText : '答案由 AI 生成,可能不准确,请自行验证。' ,
84+ relatedSourcesText : '相关来源' ,
85+ thinkingText : '思考中...' ,
86+ copyButtonText : '复制' ,
87+ copyButtonCopiedText : '已复制!' ,
88+ copyButtonTitle : '复制' ,
89+ likeButtonTitle : '赞' ,
90+ dislikeButtonTitle : '踩' ,
91+ thanksForFeedbackText : '感谢你的反馈!' ,
92+ preToolCallText : '搜索中...' ,
93+ duringToolCallText : '搜索 ' ,
94+ afterToolCallText : '已搜索' ,
95+ aggregatedToolCallText : '已搜索' ,
96+ } ,
97+ footer : {
98+ selectText : '选择' ,
99+ submitQuestionText : '提交问题' ,
100+ selectKeyAriaLabel : 'Enter 键' ,
101+ navigateText : '切换' ,
102+ navigateUpKeyAriaLabel : '向上箭头' ,
103+ navigateDownKeyAriaLabel : '向下箭头' ,
104+ closeText : '关闭' ,
105+ backToSearchText : '返回搜索' ,
106+ closeKeyAriaLabel : 'Esc 键' ,
107+ poweredByText : '搜索提供者' ,
108+ } ,
109+ } ,
110+ } ,
111+ }
112+ }
0 commit comments