Skip to content

Commit

Permalink
i18n(zh-cn): Update basics/astro-pages.mdx (#8577)
Browse files Browse the repository at this point in the history
* i18n(zh-cn): Update `basics/astro-pages.mdx`

* 更新 astro-pages.mdx

Co-authored-by: liruifengv <[email protected]>

---------

Co-authored-by: liruifengv <[email protected]>
  • Loading branch information
100gle and liruifengv committed Jun 20, 2024
1 parent d570c0a commit 9596625
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/content/docs/zh-cn/basics/astro-pages.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Astro 使用一种名为 **基于文件的路由** 的路由策略。`src/pages/

一个文件也可以使用[动态路由](/zh-cn/guides/routing/#动态路由)来生成多个页面。这允许你即使内容不在特殊的 `/pages/` 目录中,也可以创建页面,例如在[内容集合](/zh-cn/guides/content-collections/)[内容管理系统](/zh-cn/guides/cms/)中。

<ReadMore>了解更多关于 [Astro 路由](/zh-cn/guides/routing/)的内容。</ReadMore>
<ReadMore>了解更多关于 [Astro 路由](/zh-cn/guides/routing/) 的内容。</ReadMore>

### 页面之间的链接

Expand Down Expand Up @@ -95,10 +95,22 @@ title: '我的 Markdown 页面'

## 自定义 404 错误页面

想要自定义 404 错误页面,你可以在 `/src/pages` 中创建 `404.astro``404.md` 文件。
想要自定义 404 错误页面,你可以在 `src/pages` 中创建 `404.astro``404.md` 文件。

它将生成 `404.html` 页面。大多数[部署服务](/zh-cn/guides/deploy/)都自动找到并使用它。

## 自定义 500 错误页面


要为[按需渲染的页面](/zh-cn/guides/server-side-rendering/#启用按需服务器渲染)创建自定义的 500 错误页面,可以创建一个 `src/pages/500.astro` 文件。但这个自定义页面不适用于预渲染的页面,也不能被预渲染。

如果在渲染此页面时发生错误,将显示主机默认的 500 错误页面给访问者。

<p><Since v="4.10.3" /></p>

在开发过程中,如果你有一个 `500.astro` 文件,运行时抛出的错误将被记录在终端中,而不是显示在错误覆盖层中。


## 局部页面

<p><Since v="3.4.0" /></p>
Expand Down

0 comments on commit 9596625

Please sign in to comment.