Skip to content

Commit 966e31f

Browse files
liruifengvHiDeoo
andauthored
i18n(zh-cn): Update manual-setup.mdx (#2768)
Co-authored-by: HiDeoo <494699+HiDeoo@users.noreply.github.com>
1 parent 43b721a commit 966e31f

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

docs/src/content/docs/zh-cn/manual-setup.mdx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,24 @@ export default defineConfig({
6262

6363
### 配置内容集合
6464

65-
Starlight 是建立在 Astro 的[内容集合](https://docs.astro.build/zh-cn/guides/content-collections/)之上的,这些集合在 `src/content/config.ts` 文件中配置。
65+
Starlight 是建立在 Astro 的[内容集合](https://docs.astro.build/zh-cn/guides/content-collections/)之上的,这些集合在 `src/content.config.ts` 文件中配置。
6666

67-
创建或更新内容配置文件,添加一个使用 Starlight 的 `docsSchema``docs` 集合:
67+
创建或更新内容配置文件,添加一个使用 Starlight 的 `docsLoader``docsSchema``docs` 集合:
6868

69-
```js ins={3,6}
70-
// src/content/config.ts
69+
```js ins={3-4,7}
70+
// src/content.config.ts
7171
import { defineCollection } from 'astro:content';
72+
import { docsLoader } from '@astrojs/starlight/loaders';
7273
import { docsSchema } from '@astrojs/starlight/schema';
7374

7475
export const collections = {
75-
docs: defineCollection({ schema: docsSchema() }),
76+
docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }),
7677
};
7778
```
7879

80+
Starlight 也支持 [`legacy.collections` 标志](https://docs.astro.build/zh-cn/reference/legacy-flags/),其中集合使用旧版的内容集合实现处理。
81+
这对于你有一个现有的 Astro 项目,目前无法对集合进行任何更改以使用加载器的情况非常有用。
82+
7983
### 添加内容
8084

8185
现在 Starlight 已经配置好了,是时候添加一些内容了!
@@ -124,6 +128,6 @@ import { FileTree } from '@astrojs/starlight/components';
124128

125129
### 结合 SSR 使用 Starlight
126130

127-
要启用 SSR,请按照 Astro 文档中的 [“按需渲染适配器”](https://docs.astro.build/zh-cn/guides/server-side-rendering/) 指南将服务器适配器添加到你的 Starlight 项目中。
131+
要启用 SSR,请按照 Astro 文档中的 [“按需渲染适配器”](https://docs.astro.build/zh-cn/guides/on-demand-rendering/) 指南将服务器适配器添加到你的 Starlight 项目中。
128132

129133
无论项目的输出模式如何,Starlight 生成的文档页面都默认为预渲染。要选择不对 Starlight 页面进行预渲染,请将 [`prerender` 配置选项](/zh-cn/reference/configuration/#prerender) 设置为 `false`

0 commit comments

Comments
 (0)