Skip to content

Commit

Permalink
i18n(zh-cn): Update site-search.mdx (#2773)
Browse files Browse the repository at this point in the history
Co-authored-by: HiDeoo <[email protected]>
  • Loading branch information
liruifengv and HiDeoo authored Jan 8, 2025
1 parent caa0d11 commit 3c4fa1c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions docs/src/content/docs/zh-cn/guides/site-search.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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() }),
}),
};
Expand Down

0 comments on commit 3c4fa1c

Please sign in to comment.