From 3c4fa1c50547f85d3a7d13d46937fa4e56865cc3 Mon Sep 17 00:00:00 2001 From: liruifengv Date: Wed, 8 Jan 2025 17:06:39 +0800 Subject: i18n(zh-cn): Update site-search.mdx (#2773) Co-authored-by: HiDeoo <494699+HiDeoo@users.noreply.github.com>--- docs/src/content/docs/zh-cn/guides/site-search.mdx | 11 ++++++----- 1 file 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 文本。 -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() }), }), }; -- cgit