Skip to content
Merged
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
10 changes: 8 additions & 2 deletions src/content/docs/zh-cn/core-concepts/astro-pages.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ Astro 使用一种名为 **基于文件的路由** 的路由策略。`src/pages/

### 页面之间的链接

在你的 Astro 页面中,使用标准的 HTML [`<a>` 元素](https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/a)来链接到网站上的其他页面。
在你的 Astro 页面中,使用标准的 HTML [`<a>` 元素](https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/a)来链接到网站上的其他页面。这需要使用 **相对于根域名的 URL 路径** 作为你的链接,而不是相对文件路径。

例如,要从 `example.com` 上的任何其他页面链接到 `https://example.com/authors/sonali/`,你可以像这样:

```astro title="src/pages/index.astro"
阅读更多 <a href="/authors/sonali/">关于 Sonali 的信息</a>。
```

## Astro 页面

Expand Down Expand Up @@ -68,7 +74,7 @@ Astro 还将 `src/pages/` 目录中的任何 Markdown (`.md`) 文件视为网站

```md {3}
---
# 举例: src/pages/page.md
# 举例src/pages/page.md
layout: '../layouts/MySiteLayout.astro'
title: '我的 Markdown 页面'
---
Expand Down