> For the complete documentation index, see [llms.txt](https://gitbook.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.com/docs/documentation/zh/creating-content/content-structure/page.md).

# 页面

页面是你可以添加、编辑和嵌入内容的地方。页面始终位于某个章节内，让你可以将与你所覆盖的主题或领域相关的内容分组。

当你发布网站时，每个章节都会出现在站点导航中，其内的所有页面都会显示在该章节下。

### 目录

在一个章节中创建任意数量的页面。它们都会显示在你屏幕左侧边栏中、该章节目录里。目录会在你发布的网站中出现在同一位置，除非 [你选择将其隐藏](#page-options).

{% hint style="info" %}
**章节落地页**

目录中的第一页始终是该章节的落地页，即使它在目录中被隐藏。
{% endhint %}

### 创建新页面

1. 进入实时编辑模式或打开更改请求。
2. 点击 **添加新项...** 位于目录底部。
3. 点击 **页面**.

或者将鼠标悬停在目录中的页面之间，然后点击 **+** 出现的图标。

<figure><img src="/files/986411095bcecfb89d926e11cb0971b6ee2c7cb2" alt="A GitBook screenshot showing an empty page listed in the table of contents"><figcaption><p>GitBook 中的空白页面。你可以在左侧的目录中看到它被列出。</p></figcaption></figure>

### 缺少新页面选项

{% hint style="warning" %}
如果你的章节已禁用实时编辑，请创建或编辑更改请求。在更改请求中， **新页面** 按钮——它会创建页面、页面组和链接——可在目录中使用。

你也可能没有编辑页面的权限。
{% endhint %}

### 整理你的内容

在目录中组织内容有三种方式：

#### 页面

页面有标题、可选描述，以及一个你可以撰写并添加任意类型内容的区域。

通过在目录中将一个页面拖放到另一个页面下方来嵌套页面。这样会创建一个 **子页面**.

如果你向一个空的父页面添加子页面，GitBook 会自动生成一个“目录”页面，在已发布的文档版本中包含指向所有子页面的链接。

{% hint style="info" %}
**提示：** 页面嵌套没有限制，但为保持导航简洁，建议不要超过三层。
{% endhint %}

当你更改页面标题时，页面的 slug（URL 最末尾的部分，例如 `/hello-world`）也会随之更改——除非你之前手动设置过该页面的 slug。

要更改页面的标题、链接标题或 slug：

1. 打开该页面的 **操作菜单** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="/files/d05670ba93b683794fb3fe95a9fc7ab5c7fceafd" alt="The Actions menu icon in GitBook"></picture>.
2. 点击 **编辑标题和 slug**.

#### 页面链接标题

如果你想为页面设置一个更长、更利于 SEO 的标题，同时为导航项和链接保留较短的标题，请定义一个链接标题。

1. 打开该页面的 **操作菜单** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="/files/d05670ba93b683794fb3fe95a9fc7ab5c7fceafd" alt="The Actions menu icon in GitBook"></picture>.
2. 点击 **编辑标题和 slug**.
3. 在 **编辑页面** 对话框中，为该页面启用并定义链接标题。

如果你使用 Git Sync，请在 `SUMMARY.md` 中的页面链接上设置页面链接标题：

```markdown
# 目录

* [页面主标题](page.md "页面链接标题")
```

{% hint style="info" %}
**注意：** 页面链接标题会显示在目录中、每个页面底部的分页按钮上，以及你添加到该页面的任何相对链接中。
{% endhint %}

页面链接标题是可选的——如果你不添加，页面将使用其标准标题。

#### 页面组

页面组将相关页面在某个章节的目录中归拢在一起。

{% hint style="info" %}
页面组用于组织 **页面** 在单个章节内。要组织你网站的 **版块** 内容，请改用分组。
{% endhint %}

通过点击创建页面组 **添加新项...** > **分组** 位于目录底部。

页面组仅存在于目录的 **顶层** ——你不能将页面组彼此嵌套。

要更改页面组的标题和 slug：

1. 点击组旁边的 **操作菜单** 图标 <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="/files/d05670ba93b683794fb3fe95a9fc7ab5c7fceafd" alt="The Actions menu icon in GitBook"></picture> 旁边的图标。
2. 点击 **重命名**.

#### 外部链接

向你的目录添加链接，直接将用户带到链接内容。

通过点击创建外部链接 **添加新项...** > **外部链接** 位于目录底部。

### 页面图标和表情符号

为了在读者浏览目录时提高可读性，你可以为单个页面添加可选图标或表情符号。图标或表情符号会显示在目录中，以及页面顶部标题旁边。

要添加图标或表情符号，请点击 **添加图标** 按钮（将鼠标悬停在页面标题上时出现），或标题左侧的表情符号按钮。

### 页面选项

在 **页面选项** 菜单，自定义所选章节内某个页面的外观和可见性。

#### 布局

打开 **页面选项** <picture><source srcset="/files/tb21SaZbz1g0fv6lzP83" media="(prefers-color-scheme: dark)"><img src="/files/6a30cd6208acd9ffde74dde60d509397c5265fc8" alt="The Page options menu icon in GitBook"></picture> 菜单，或将鼠标悬停在页面标题上更改页面封面。按钮会出现在

在 **页面选项** 侧边面板中，选择每个页面在你的 **已发布** 内容中向访问者显示的方式。你可以选择三种布局预设，或者创建自定义布局。

每种布局预设都会开启或关闭页面的以下部分：

* 页面标题
* 页面描述
* 目录
* 页面大纲
* 下一页/上一页链接
* 页面元数据
* 标签

从 **资源库** → **标签**中。开启 **在页面上显示标签** 以在页面页眉中显示它们。或者选择一个标签作为页面的主要标签，GitBook 可以将其显示在目录中页面旁边。更多信息请参阅标签。

也可以在此菜单中设置页面的全局宽度。选择 **宽** 会让表格、卡片和代码块等内容在已发布页面上拥有更多空间。可用于醒目的落地页。

#### 可见性

选择在已发布的文档中显示或隐藏哪些页面，以及每个页面是否出现在站点搜索和搜索引擎中。

要从站点目录中隐藏某个页面或页面组：

1. 打开该页面的 **操作菜单** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="/files/d05670ba93b683794fb3fe95a9fc7ab5c7fceafd" alt="The Actions menu icon in GitBook"></picture>.
2. 切换 **隐藏页面**.

隐藏的页面仅会从已发布的目录中隐藏。它们仍可通过站点的 MCP 服务器以及 `llms-full.txt`.

如果你使用 Git Sync，隐藏页面会在 Markdown 文件中包含以下 front matter：

<pre class="language-markdown" data-title="page.md"><code class="lang-markdown">---
hidden: true
<strong>---
</strong></code></pre>

{% hint style="warning" %}
隐藏 **页面标题** 或 **页面描述** 仅会隐藏已发布内容中的页面页眉。不会移除页面正文中的标题。有关标题层级的更多信息，请参阅标题。
{% endhint %}

#### 元数据（SEO）

使用 **页面选项 → 元数据** 来控制搜索引擎如何理解相似页面之间的关系（例如：文档版本或内容变体）。

* **规范 URL**：此页面首选的（权威）URL。搜索引擎会将其视为“真实来源”。当多个 URL 显示相同内容时使用它。
* **备用 URL**：同一内容在另一变体中的其他 URL。例如，另一个版本或语言。它们有助于搜索引擎对变体进行分组，而不是将其视为重复内容。

这两个字段都支持选择另一 GitBook 页面（推荐）或输入外部 URL。

{% hint style="info" %}
版本化文档的常见做法是将较旧的页面设为与最新的对应页面相同的规范页（例如， `1.0` → `2.0`），然后在最新页面上将旧版本列为备用项。
{% endhint %}

### 页面封面

为你文档的每个页面设置封面。点击 **页面封面** <picture><source srcset="/files/m3pW0fk37zO88JKWr4U5" media="(prefers-color-scheme: dark)"><img src="/files/0b02907892f52447a431fdbae0f4eb572c21800f" alt="The Page cover icon in GitBook"></picture> 选项时，GitBook 会立即添加一个默认封面。你可以在这里：

* **更改封面图片**
  1. 将鼠标悬停在页面封面上并点击 **更改封面**.
  2. 选择或上传图片。理想尺寸是 1990x480 像素。
* **重新定位封面图片**
  1. 将鼠标悬停在页面封面上并打开 **操作菜单** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="/files/d05670ba93b683794fb3fe95a9fc7ab5c7fceafd" alt="The Actions menu icon in GitBook"></picture>.
  2. 点击 **重新定位**.
  3. 将图片拖动到位并点击 **保存**.
* **移除封面图片**
  1. 将鼠标悬停在页面封面上并打开 **操作菜单** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="/files/d05670ba93b683794fb3fe95a9fc7ab5c7fceafd" alt="The Actions menu icon in GitBook"></picture>.
  2. 点击 **移除**.
* **全宽和英雄宽**

  更改页面封面的样式，使其横跨整个屏幕宽度，或仅与内容宽度一致。

  1. 将鼠标悬停在页面封面上并打开 **操作菜单** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="/files/d05670ba93b683794fb3fe95a9fc7ab5c7fceafd" alt="The Actions menu icon in GitBook"></picture>.
  2. 点击你偏好的选项。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://gitbook.com/docs/documentation/zh/creating-content/content-structure/page.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
