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

Merged
merged 39 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
cc4af6a
i18n(zh-cn): Update `mixed-content-data-collection-error.mdx`
Nin3lee Jan 9, 2025
738fbfd
Update `mixed-content-data-collection-error.mdx`
Nin3lee Jan 9, 2025
5b31527
Update `content-collection-type-mismatch-error.mdx`
Nin3lee Jan 9, 2025
3987ff2
[WIP]i18n(zh-cn): Add `v5.mdx`
Nin3lee Jan 10, 2025
0e806e8
[WIP] Update `v5.mdx`
Nin3lee Jan 13, 2025
f063fb2
Update v5.mdx
Nin3lee Jan 14, 2025
19406f4
Merge branch 'main' into patch-7
Nin3lee Jan 14, 2025
f0053f3
fix: broken link in `content-collections.mdx`
Nin3lee Jan 14, 2025
538b352
fix: broken link in `content-schema-contains-slug-error.mdx`
Nin3lee Jan 14, 2025
c25d009
fix: part of broken link in `v5.mdx`
Nin3lee Jan 14, 2025
ea7c187
Update `integrations-reference.mdx`
Nin3lee Jan 14, 2025
22034b2
Update `integrations-reference.mdx`
Nin3lee Jan 14, 2025
1d21dc7
fix: broken link in `v5.mdx`
Nin3lee Jan 14, 2025
bbafd43
fix: broken link in `integrations-reference.mdx`
Nin3lee Jan 14, 2025
73d40c4
fix: broken link in `adapter-reference.mdx`
Nin3lee Jan 14, 2025
564b1de
Update `integrations-reference.mdx` from #10410
Nin3lee Jan 14, 2025
682722d
Update src/content/docs/zh-cn/reference/errors/content-collection-typ…
Nin3lee Jan 16, 2025
02dd0b0
Update src/content/docs/zh-cn/reference/errors/mixed-content-data-col…
Nin3lee Jan 16, 2025
8fd2f87
Update src/content/docs/zh-cn/guides/upgrade-to/v5.mdx
Nin3lee Jan 16, 2025
365e939
Update src/content/docs/zh-cn/guides/upgrade-to/v5.mdx
Nin3lee Jan 16, 2025
11a9e57
Update src/content/docs/zh-cn/guides/upgrade-to/v5.mdx
Nin3lee Jan 16, 2025
741706a
Update src/content/docs/zh-cn/guides/upgrade-to/v5.mdx
Nin3lee Jan 16, 2025
8b22d38
Update src/content/docs/zh-cn/guides/content-collections.mdx
Nin3lee Jan 16, 2025
51fd0fa
Update src/content/docs/zh-cn/reference/errors/content-collection-typ…
Nin3lee Jan 16, 2025
c2e5abb
Update src/content/docs/zh-cn/reference/errors/mixed-content-data-col…
Nin3lee Jan 16, 2025
a5c211a
Update src/content/docs/zh-cn/reference/errors/content-schema-contain…
Nin3lee Jan 16, 2025
bad9d84
Update src/content/docs/zh-cn/reference/errors/mixed-content-data-col…
Nin3lee Jan 16, 2025
34edec0
Update src/content/docs/zh-cn/guides/upgrade-to/v5.mdx
Nin3lee Jan 16, 2025
63e040a
Update src/content/docs/zh-cn/guides/upgrade-to/v5.mdx
Nin3lee Jan 16, 2025
2a53ec4
Update src/content/docs/zh-cn/guides/upgrade-to/v5.mdx
Nin3lee Jan 16, 2025
6addc39
Update src/content/docs/zh-cn/guides/upgrade-to/v5.mdx
Nin3lee Jan 16, 2025
08b89d2
Update src/content/docs/zh-cn/guides/upgrade-to/v5.mdx
Nin3lee Jan 16, 2025
f57a6c8
Update src/content/docs/zh-cn/guides/upgrade-to/v5.mdx
Nin3lee Jan 16, 2025
c72fb8d
Update src/content/docs/zh-cn/guides/upgrade-to/v5.mdx
Nin3lee Jan 16, 2025
e9a9910
Update src/content/docs/zh-cn/guides/upgrade-to/v5.mdx
Nin3lee Jan 16, 2025
0c1ce39
Update src/content/docs/zh-cn/guides/upgrade-to/v5.mdx
Nin3lee Jan 16, 2025
15c984d
Update src/content/docs/zh-cn/guides/upgrade-to/v5.mdx
Nin3lee Jan 16, 2025
7cb3b5d
Update `v4.mdx` from discussion
Nin3lee Jan 16, 2025
e2dd6fa
Merge branch 'main' into patch-7
liruifengv Jan 16, 2025
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
2 changes: 1 addition & 1 deletion src/content/docs/zh-cn/guides/upgrade-to/v4.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro'
:::note[需要继续吗?]
升级 Astro 到最新版本后,你可能不需要对你的项目做任何更改!

但是,如果你注意到错误或意外的行为,请检查下面的内容,看看有什么变化可能需要在你的项目中更新。
但是,如果你遇到错误或意外的行为,请检查下面的内容,看看有什么变化可能需要在你的项目中更新。
:::

Astro v4.0 包含[潜在的破坏性](#破坏性更改),以及[一些之前被弃用的功能被移除](#之前弃用的功能已被移除)。
Expand Down
1,203 changes: 1,203 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 @@ -8,9 +8,9 @@ githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/

## 哪里发生了错误?

旧版的内容集合模式不应包含 `slug` 字段。这个字段是由 Astro 用于生成条目 slug 的保留字段。请从该模式中删除 slug 字段。你可以在前置信息中使用自定义的 slugs。
旧版内容集合的 schema 不应包含 `slug` 字段。这个字段是由 Astro 用于生成条目 slug 的保留字段。请从 schema 中删除 slug 字段。你仍然可以在 frontmatter 中使用自定义的 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/

## 哪里发生了错误?

一个内容集合不能同时包含内容和数据条目。必须按类型将条目存储在单独的集合中。
旧版的内容集合不能同时包含内容(content)和数据(data)条目。必须按类型将条目存储在单独的集合中。

**请参阅:**

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