> 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/manage-your-site/site-structure.md).

# 站点结构

使用分区、变体和外部链接组织你已发布的文档

您网站上的内容位于各个 [分区](https://gitbook.com/docs/documentation/zh/chuang-jian-nei-rong/content-structure/space.md)中。您可以添加一个或多个分区。GitBook 会发布每个分区，并处理它们之间的导航。

## 内容类型

你网站中的内容可以作为两种不同内容类型之一，这决定了 GitBook 如何处理它并向访客展示它。

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-type="image">封面图片（深色）</th><th data-hidden data-card-cover data-type="image">封面图片</th><th data-hidden data-card-target data-type="content-ref"></th><th data-hidden><select></select></th><th data-hidden data-card-cover-dark data-type="image">封面图片（深色）</th></tr></thead><tbody><tr><td><strong>分区</strong></td><td>将你的网站拆分为彼此独立的部分——非常适合多个产品或你组织的不同部门。</td><td><a href="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-12ea6e551e1e565fa8de101106fd0171c5de2f5b%2F25_08_29_site_sections.svg?alt=media">25_08_29_site_sections.svg</a></td><td><a href="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-ec53f8f7499d7ad408a21dbad800676453bb3026%2F25_12_10_site_sections_1.png?alt=media">25_12_10_site_sections_1.png</a></td><td><a href="https://gitbook.com/docs/documentation/zh/manage-your-site/site-structure/site-sections.md">分区</a></td><td></td><td><a href="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-da4dae17d68633634557ef1231d752e7ad5f93ff%2F25_12_10_site_sections.png?alt=media">25_12_10_site_sections.png</a></td></tr><tr><td><strong>内容变体</strong></td><td>发布同一内容的多个版本——非常适合本地化、版本控制等。</td><td><a href="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-deae71cbecc45bb8df4a45ac759fbce15ef71308%2F25_08_29_content_variants.svg?alt=media">25_08_29_content_variants.svg</a></td><td><a href="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-c5b1ce79a08b476db23db7c01de73249ce6d3dce%2F25_12_10_content_variants_1.png?alt=media">25_12_10_content_variants_1.png</a></td><td><a href="https://gitbook.com/docs/documentation/zh/manage-your-site/site-structure/variants.md">内容变体</a></td><td></td><td><a href="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-f650b6888150ed69e6a055ea47f9732332e64092%2F25_12_10_content_variants.png?alt=media">25_12_10_content_variants.png</a></td></tr></tbody></table>

## 管理你的网站结构

通过管理你的网站结构，你也可以管理网站顶部导航栏。此导航栏允许访客打开各部分、组和外部链接。

在站点侧边栏中打开 **站点结构** ，即可打开结构编辑器。在这里，您可以查看站点的分区、变体和外部链接。

您的站点最初包含一个单独的部分，其中有您站点的名称，以及一个包含您在站点设置期间创建的内容的单一变体。

<figure><img src="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-b13c3123b0d22ce9fce674e4d650a32ac78b5078%2F25_12_10_structure_light.png?alt=media" alt="A GitBook screenshot showing a docs site&#x27;s structure"><figcaption><p>已发布文档站点的结构。</p></figcaption></figure>

### 向你的文档站点添加一个部分

要添加 [分区](https://gitbook.com/docs/documentation/zh/manage-your-site/site-structure/site-sections.md)，请点击表格下方的 **添加分区** 按钮，然后选择要添加的内容。新分区随后会添加到表格中，并作为站点顶部的标签页供访客访问。

要添加 [变体](https://gitbook.com/docs/documentation/zh/manage-your-site/site-structure/variants.md)，请点击要添加到的分区中的 **添加变体** 按钮，然后选择要添加的内容。新变体随后会添加到所选分区的变体列表中，并显示在站点的变体下拉菜单中，供访客选择。

当你添加内容——作为变体或部分——时，系统会根据其标题生成名称和 slug。

### 添加外部链接

外部链接会将你网站外的目标加入导航中。你可以将链接作为独立的导航项添加，或将其放在与相关部分一起的部分组中。

要添加外部链接：

1. 在站点侧边栏中打开 **站点结构**.
2. 在添加菜单中，选择 **外部链接**.
3. 输入链接标签和目标 URL。
4. 选择是单独添加该链接，还是添加到某个部分组中。
5. 点击 **保存**.

该链接会以你选择的位置出现在已发布网站的导航中。

### 更改部分或变体

<div data-full-width="false"><figure><img src="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-006e95ace860b31f7ec4f29b24eca552ea2c0dcf%2F25_12_10_edit_variant_light.png?alt=media" alt="A GitBook screenshot showing how to edit a variant"><figcaption><p>更新网站部分或变体。</p></figcaption></figure></div>

点击要编辑项目所在表格行中的 **编辑** <picture><source srcset="broken://files/kN09oTFtAuyaxNIwWuCt" media="(prefers-color-scheme: dark)"><img src="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-d28f11ed4dfafb06aa9c6ae92db8017d94014317%2F25_01_10_edit_icon_light.svg?alt=media" alt="The Edit icon in GitBook"></picture> 按钮，即可更改分区和变体的名称及别名。此操作会打开一个模态框。编辑要更改的字段，然后点击 **保存** 按钮以保存更改。

{% hint style="info" %}
更改分区的别名会改变其规范 URL。GitBook 会自动将旧 URL 重定向到新 URL。您也可以 [手动创建重定向](https://gitbook.com/docs/documentation/zh/publish/site-redirects.md).
{% endhint %}

{% hint style="info" %}
slug 在整个组织中都是唯一的——即使跨不同站点，每个路径也只能用于一个站点。如果你看到“路径已被占用”错误，说明另一个站点已经在使用该 slug。请选择一个略有不同但仍能体现内容含义的 slug。
{% endhint %}

要替换分区或变体，请先点击其 **编辑** <picture><source srcset="broken://files/kN09oTFtAuyaxNIwWuCt" media="(prefers-color-scheme: dark)"><img src="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-d28f11ed4dfafb06aa9c6ae92db8017d94014317%2F25_01_10_edit_icon_light.svg?alt=media" alt="The Edit icon in GitBook"></picture> 按钮将其删除，然后点击模态框左下角的 **删除** 按钮。删除项目后，点击 **添加分区** 或 **添加变体** 按钮，再次添加该项目。

### 重新排序部分或变体

站点会按照分区和变体在 **站点结构** 表格中的顺序显示它们。您可以抓住 **拖动手柄** <picture><source srcset="broken://files/QLUQj6waZRiK6FpSqrt6" media="(prefers-color-scheme: dark)"><img src="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-23f3e8f05326b0d239d32d28bba99c1d46f204f7%2F25_01_10_options_light.svg?alt=media" alt="The Options menu icon in GitBook"></picture> 并上下移动来调整顺序。更改后的顺序会立即反映在站点上。

你也可以使用键盘选择并移动内容。按空格键选择一个部分或变体，然后使用方向键将其上下移动。再次按空格键确认新位置。

### 设置默认内容

如果站点包含多个分区，其中一个会标记为 **默认**。访客访问站点时会看到此分区，它使用站点的根 URL。其他分区各自有一个附加到根 URL 后的别名。

如果某个部分中有多个变体，其中一个变体会被标记为默认。与部分类似，默认变体会在访客进入你的网站时显示，或者在他们访问某个部分时显示。其他变体各自都有一个附加到该部分 URL 的 slug。

要将某个分区或变体设为默认项，请点击其表格行中的 **操作菜单** <picture><source srcset="broken://files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-aabbca522107ef561981bdfe5af94605b31e0920%2F25_01_10_actions_icon_light.svg?alt=media" alt="The Actions menu icon in GitBook"></picture> ，然后点击 **设为默认**.

{% hint style="info" %}
按钮。将内容设为默认会移除其 slug 字段，因为它将改为从该部分根路径提供。GitBook 会将旧 slug 重定向到相应路径，以确保访客继续看到你的内容。
{% endhint %}

### 从站点中移除内容

若要从网站中移除某个版块或变体，请从 **网站结构** 打开侧边栏中的结构编辑器，然后找到要移除的内容。

打开要移除内容对应的 **操作菜单** <picture><source srcset="broken://files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-aabbca522107ef561981bdfe5af94605b31e0920%2F25_01_10_actions_icon_light.svg?alt=media" alt="The Actions menu icon in GitBook"></picture> 并选择 **移除**.

{% hint style="success" %}
从网站中移除内容会将其从已发布的网站上移除，但 **不会删除内容本身** ——你仍然可以在 [所有内容](https://gitbook.com/docs/documentation/zh/chuang-jian-nei-rong/content-structure/all-content.md).
{% endhint %}

如果彻底删除某个版块的内容，网站及其设置和自定义项仍会保留。已删除的内容会在 **回收站** 中保留七天，之后才会被永久删除。如果被删除的版块是网站的默认版块，请检查默认设置是否仍然正确。


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://gitbook.com/docs/documentation/zh/manage-your-site/site-structure.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
