summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorliruifengv2025-01-08 17:06:39 +0800
committerGitHub2025-01-08 10:06:39 +0100
commit3c4fa1c50547f85d3a7d13d46937fa4e56865cc3 (patch)
treeb280ee7af30536cdfe9e30011029773c5204511f
parentcaa0d117e1defcdba861e4a486d209a63c3ff9e1 (diff)
downloadIT.starlight-3c4fa1c50547f85d3a7d13d46937fa4e56865cc3.tar.gz
IT.starlight-3c4fa1c50547f85d3a7d13d46937fa4e56865cc3.tar.bz2
IT.starlight-3c4fa1c50547f85d3a7d13d46937fa4e56865cc3.zip
i18n(zh-cn): Update site-search.mdx (#2773)
Co-authored-by: HiDeoo <494699+HiDeoo@users.noreply.github.com>
-rw-r--r--docs/src/content/docs/zh-cn/guides/site-search.mdx11
1 files changed, 6 insertions, 5 deletions
diff --git a/docs/src/content/docs/zh-cn/guides/site-search.mdx b/docs/src/content/docs/zh-cn/guides/site-search.mdx
index 800226d8..ef95518d 100644
--- a/docs/src/content/docs/zh-cn/guides/site-search.mdx
+++ b/docs/src/content/docs/zh-cn/guides/site-search.mdx
@@ -124,18 +124,19 @@ DocSearch 默认只提供了英语 UI 文本。
<Steps>
-1. 在 `src/content/config.ts` 中给 Starlight 的 `i18n` 内容集合定义添加 DocSearch schema:
+1. 在 `src/content.config.ts` 中给 Starlight 的 `i18n` 内容集合定义添加 DocSearch schema:
- ```js ins={4} ins=/{ extend: .+ }/
- // src/content/config.ts
+ ```js ins={5} ins=/{ extend: .+ }/
+ // src/content.config.ts
import { defineCollection } from 'astro:content';
+ import { docsLoader, i18nLoader } from '@astrojs/starlight/loaders';
import { docsSchema, i18nSchema } from '@astrojs/starlight/schema';
import { docSearchI18nSchema } from '@astrojs/starlight-docsearch/schema';
export const collections = {
- docs: defineCollection({ schema: docsSchema() }),
+ docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }),
i18n: defineCollection({
- type: 'data',
+ loader: i18nLoader(),
schema: i18nSchema({ extend: docSearchI18nSchema() }),
}),
};