Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n(zh-cn): Update v5.mdx and related docs #10702

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/content/docs/zh-cn/guides/content-collections.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import ReadMore from "~/components/ReadMore.astro"
Astro 5.0 引入了内容层(Content Layer)API,用于定义和查询内容集。这个高性能、可扩展的 API 为本地集合提供了内置的内容加载器(content loaders)。对于远程内容,你可以使用第三方和社区构建的加载器,或者创建自己的自定义加载器,从任何来源拉取数据。

:::note
项目可以继续使用 Astro v2.0 中引入的传统内容集合 API。但是,我们鼓励尽可能 [更新任何现有集合](/zh-cn/guides/upgrade-to/v5/#legacy-v20-content-collections-api)
项目可以继续使用 Astro v2.0 中引入的传统内容集合 API。但是,我们鼓励尽可能 [更新任何现有集合](/zh-cn/guides/upgrade-to/v5/#遗留v20-内容集合-api)
:::

## 什么是内容集合?
Expand Down
1,204 changes: 1,204 additions & 0 deletions src/content/docs/zh-cn/guides/upgrade-to/v5.mdx

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/content/docs/zh-cn/reference/adapter-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ try {
**默认值:** `app.match(request)`
</p>

如果你已经知道要渲染的路由,请为 [`integrationRouteData`](/zh-cn/reference/integrations-reference/#routedata-类型参考) 提供一个值。这样做将绕过内部调用 [`app.match`](#appmatch) 来确定要渲染的路由。
如果你已经知道要渲染的路由,请为 [`integrationRouteData`](/zh-cn/reference/integrations-reference/#integrationroutedata-类型参考) 提供一个值。这样做将绕过内部调用 [`app.match`](#appmatch) 来确定要渲染的路由。

```js "routeData"
const routeData = app.match(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/

## 哪里发生了错误?

内容集合必须包含所配置的类型。默认类型为 `type: 'content'`。试着为数据集合添加 `type: 'data'` 的类型。
遗留的内容集合必须包含所配置的类型。默认类型为 `type: 'content'`。试着为数据集合添加 `type: 'data'` 的类型。

**请参阅:**

- [定义内容集合](/zh-cn/guides/content-collections/#定义集合)
- [遗留的内容集合](/zh-cn/guides/upgrade-to/v5/#升级现有的集合)
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/
旧版的内容集合模式不应包含 `slug` 字段。这个字段是由 Astro 用于生成条目 slug 的保留字段。请从该模式中删除 slug 字段。你可以在前置信息中使用自定义的 slugs。

**请参阅:**
- [旧版内容集合](/zh-cn/guides/upgrade-to/v5/#updating-existing-collections)
- [旧版内容集合](/zh-cn/guides/upgrade-to/v5/#升级现有的集合)


Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/

## 哪里发生了错误?

一个内容集合不能同时包含内容和数据条目。必须按类型将条目存储在单独的集合中。
一个遗留的内容集合不能同时包含内容和数据条目。必须按类型将条目存储在单独的集合中。

**请参阅:**

- [定义内容集合](/zh-cn/guides/content-collections/#定义集合)
- [遗留的内容集合](/zh-cn/guides/upgrade-to/v5/#升级现有的集合)
Loading
Loading