Skip to content

Commit 97452aa

Browse files
committed
feat: add tsconfig and algolia search configuration
1 parent a1d40a9 commit 97452aa

File tree

4 files changed

+98
-3
lines changed

4 files changed

+98
-3
lines changed

docs/.vitepress/config.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { defineConfig } from 'vitepress'
2+
import pkg from '../../packages/create-mcp-kit/package.json' with { type: 'json' }
23

34
// https://vitepress.dev/reference/site-config
45
export default defineConfig({
@@ -26,7 +27,7 @@ export default defineConfig({
2627
{ text: 'Home', link: '/' },
2728
{ text: 'Guide', link: '/guide/what-is-mcp', activeMatch: '/guide/' },
2829
{
29-
text: '0.0.8',
30+
text: pkg.version,
3031
items: [
3132
{
3233
text: 'Changelog',
@@ -46,5 +47,14 @@ export default defineConfig({
4647
],
4748
},
4849
],
50+
51+
search: {
52+
provider: 'algolia',
53+
options: {
54+
appId: 'V6CF28P0PS',
55+
apiKey: '692752b7b3c6f794997d8ae22aed79fa',
56+
indexName: 'create-mcp-kit',
57+
},
58+
},
4959
},
5060
})

docs/tsconfig.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "../tsconfig.root.json",
3+
"include": ["./.vitepress/**/*", "./**/*"]
4+
}

docs/zh/config.ts

Lines changed: 82 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
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
45
export 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+
}

tsconfig.root.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"strict": true,
1010
"esModuleInterop": true,
1111
"skipLibCheck": true,
12+
"declaration": true,
1213
"emitDeclarationOnly": true,
1314
"forceConsistentCasingInFileNames": true,
1415
"paths": {

0 commit comments

Comments
 (0)