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 cli-reference.mdx #10200

Merged
merged 4 commits into from
Dec 11, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
i18n(zh-cn): Update v3.mdx
  • Loading branch information
liruifengv committed Dec 5, 2024
commit e07b35c42ad32e7d4f6b507f21a6ade344276680
12 changes: 7 additions & 5 deletions src/content/docs/zh-cn/guides/upgrade-to/v3.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
title: 升级到 Astro v3
description: 如何将你的项目升级到 Astro 的最新版本 (v3.0)。
sidebar:
label: v3.0
i18nReady: true
---
import { Steps } from '@astrojs/starlight/components';
Expand Down Expand Up @@ -246,7 +248,7 @@

### 移除:将 `class:list` 作为 prop 传递

在 Astro v2.x 中,[`class:list` 的值](/zh-cn/reference/directives-reference/#classlist) 通过 [`Astro.props['class:list']`](/zh-cn/reference/api-reference/#astroprops) 传递给组件。
在 Astro v2.x 中,[`class:list` 的值](/zh-cn/reference/directives-reference/#classlist) 通过 [`Astro.props['class:list']`](/zh-cn/reference/api-reference/#props) 传递给组件。

Check failure on line 251 in src/content/docs/zh-cn/guides/upgrade-to/v3.mdx

View workflow job for this annotation

GitHub Actions / Check Links

Broken fragment link in src/content/docs/zh-cn/guides/upgrade-to/v3.mdx, line 251: The linked page does not contain a fragment with the name "#props". Available fragments: #theme-icons, #gradient, #starlight__sidebar, #start, #guides-and-recipes, #reference, #integrations, #third-party-services, #starlight__mobile-toc, #starlight__on-this-page--mobile, #starlight__on-this-page, #_top, #astro-global, #astroglob, #markdown-文件, #astro-文件, #其他文件, #astroprops, #astroparams, #astrorequest, #astroresponse, #astrocookies, #get, #has, #set, #delete, #merge, #headers, #astrocookie, #value, #json, #number, #boolean, #astrocookiegetoptions, #decode, #astrocookiesetoptions, #domain, #expires, #httponly, #maxage, #path, #samesite, #secure, #encode, #astroredirect, #astrorewrite, #astrourl, #astroclientaddress, #astrosite, #astrogenerator, #astroslots, #astroslotshas, #astroslotsrender, #astroself, #astrolocals, #astropreferredlocale, #astropreferredlocalelist, #astrocurrentlocale, #astrogetactionresult, #astrocallaction, #端点上下文, #contextparams, #contextprops, #contextrequest, #contextcookies, #contexturl, #contextclientaddress, #contextsite, #contextgenerator, #contextredirect, #contextrewrite, #contextlocals, #contextgetactionresult, #contextcallaction, #getstaticpaths, #params, #通过-props-传递数据, #paginate, #page-分页参数, #pagedata, #pagestart, #pageend, #pagesize, #pagetotal, #pagecurrentpage, #pagelastpage, #pageurlcurrent, #pageurlprev, #pageurlnext, #pageurlfirst, #pageurllast, #importmeta, #docsearch-lvl0, #issue2vboivn, #idea2vboivn, #other2vboivn, #textarea2vboivn
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep this link as outdated #astroprops, because api-reference have not update.

When api-reference updated, I will back and fix it


Astro v3.0 将 `class:list` 的值标准化为字符串,然后通过 `Astro.props['class']` 发送给组件。

Expand Down Expand Up @@ -301,7 +303,7 @@

### 移除:自动展平 `getStaticPaths()` 的返回值

在 Astro v2.x 中,`getStaticPaths()` 的返回值会自动展平,以允许返回一个二维数组而不会出错。
在 Astro v2.x 中,[`getStaticPaths()`](/zh-cn/reference/routing-reference/#getstaticpaths) 的返回值会自动展平,以允许返回一个二维数组而不会出错。

Astro v3.0 移除了对 `getStaticPaths()` 返回值的自动展平。

Expand Down Expand Up @@ -367,7 +369,7 @@

#### 我应该怎么做?

为了继续将你项目中的某些页面标记为草稿,请 [迁移到内容集合](/zh-cn/guides/content-collections/#从基于文件的路由迁移),并使用 `draft: true` frontmatter 属性 [手动过滤页面](/zh-cn/guides/content-collections/#筛选集合查询)
为了继续将你项目中的某些页面标记为草稿,请 [迁移到内容集合](/zh-cn/guides/content-collections),并使用 `draft: true` frontmatter 属性手动过滤页面

Check failure on line 372 in src/content/docs/zh-cn/guides/upgrade-to/v3.mdx

View workflow job for this annotation

GitHub Actions / Check Links

Link not using canonical url in src/content/docs/zh-cn/guides/upgrade-to/v3.mdx, line 372: Please use the proper canonical URL of the target page. This improves ranking in search engines and avoids unnecessary redirects. Suggested fix: /zh-cn/guides/content-collections/

### 废弃:在端点(endpoints)中返回简单对象

Expand Down Expand Up @@ -599,7 +601,7 @@

### 修改:`Astro.cookies.get(key)` 可以返回 `undefined`

在 Astro v2.x 中,[`Astro.cookies.get(key)`](/zh-cn/reference/api-reference/#astrocookies) 即使 cookie 不存在也会返回一个 [`AstroCookie` 对象](/zh-cn/reference/api-reference/#astrocookie)。要检查它是否存在,你需要使用 `Astro.cookies.has(key)`。
在 Astro v2.x 中,`Astro.cookies.get(key)`即使 cookie 不存在也会返回一个 `AstroCookie` 对象。要检查它是否存在,你需要使用 `Astro.cookies.has(key)`。

Astro v3.0 中,如果 cookie 不存在,`Astro.cookies.get(key)` 会返回 `undefined`。

Expand Down Expand Up @@ -627,7 +629,7 @@

#### 我应该怎么做?

要 [以编程方式运行 Astro CLI](/zh-cn/reference/cli-reference/#高级-api实验性),请使用新的实验性 JavaScript API:
要 [以编程方式运行 Astro CLI](/zh-cn/reference/programmatic-reference),请使用新的实验性 JavaScript API:

Check failure on line 632 in src/content/docs/zh-cn/guides/upgrade-to/v3.mdx

View workflow job for this annotation

GitHub Actions / Check Links

Link not using canonical url in src/content/docs/zh-cn/guides/upgrade-to/v3.mdx, line 632: Please use the proper canonical URL of the target page. This improves ranking in search engines and avoids unnecessary redirects. Suggested fix: /zh-cn/reference/programmatic-reference/

```js
import { dev, build } from "astro";
Expand Down
Loading