> 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).

# 站点结构

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

你网站上的内容位于其 [章节](/docs/documentation/zh/create-content/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%2FVdIazRjl18hxN5SzpiqR%2FSite%20sections.svg?alt=media&amp;token=2e1d4bae-4a54-4daa-96f8-b248203c6d6b">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%2FGzx9x7fzQtLb7ewwm3T2%2FSite%20sections.png?alt=media&amp;token=fdc90c1d-6dee-48d9-93d6-a72bb8438cc2">25_12_10_site_sections_1.png</a></td><td><a href="/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%2FB96TQMaauF0yst75RsML%2FSite%20sections.png?alt=media&amp;token=64f5801b-c97b-4df0-8a6e-97da7d04880d">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%2FuWpHiQp4LvA5wpM5Ovo8%2FContent%20variants.svg?alt=media&amp;token=4b02400b-8994-4319-952d-db5e97661f02">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%2FDmZINE2qLnmlv30oMxUg%2FContent%20variants.png?alt=media&amp;token=69243fd5-6aa3-44c9-a5f1-e444ad2bac86">25_12_10_content_variants_1.png</a></td><td><a href="/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%2FUbgdVlll8ekhPqtj3V3z%2FContent%20variants.png?alt=media&amp;token=f696c0df-94de-45ba-8ee7-f72c0c8f8fdf">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%2FD4oCABc0YRJAFzaaVBpn%2Fstructure%402x.png?alt=media&amp;token=4c4dd0df-8e8e-40e7-8a57-e9791d337c8f" alt="A GitBook screenshot showing a docs site&#x27;s structure"><figcaption><p>已发布文档站点的结构。</p></figcaption></figure>

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

要添加一个 [部分](/docs/documentation/zh/manage-your-site/site-structure/site-sections.md)，点击 **添加部分** 按钮，然后选择要添加的内容。新部分随后会添加到表格中，并作为你网站顶部的一个标签页供访客使用。

要添加一个 [变体](/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%2FoXvDCD0U1CNnP8pJHL1L%2Fedit_variant%402x.png?alt=media&amp;token=fcea8367-71dd-441c-9f10-37171ab7f450" alt="A GitBook screenshot showing how to edit a variant"><figcaption><p>更新网站部分或变体。</p></figcaption></figure></div>

你可以通过点击你想编辑项所在表格行中的 **编辑** <picture><source srcset="/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%2FA3OfGjPkE5GnOQvN36jN%2Fedit.svg?alt=media&amp;token=6f70239f-d889-4e64-9ec6-4801df47a48d" alt="The Edit icon in GitBook"></picture> 按钮来更改每个部分和变体的名称及 slug。这会打开一个模态窗口。编辑你想更改的字段，然后点击 **保存** 按钮以保存。

{% hint style="info" %}
更改部分的 slug 会更改其规范 URL。GitBook 会从旧 URL 自动重定向到新 URL。你也可以 [手动创建重定向](/docs/documentation/zh/publish/site-redirects.md).
{% endhint %}

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

要替换某个部分或变体，先点击其 **编辑** <picture><source srcset="/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%2FA3OfGjPkE5GnOQvN36jN%2Fedit.svg?alt=media&amp;token=6f70239f-d889-4e64-9ec6-4801df47a48d" alt="The Edit icon in GitBook"></picture> 按钮将其删除，然后点击 **删除** 按钮，位于模态窗口左下角。项目删除后，点击 **添加部分** 或 **添加变体** 按钮再次添加。

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

你的网站会按它们在 **站点结构** 表格中出现的顺序显示部分和变体。你可以通过抓住 **拖拽手柄** <picture><source srcset="/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%2FaS1QvPIBVYwhpFTGcPBN%2Foptions-menu.svg?alt=media&amp;token=3ee40bbf-f4fb-41fa-aa30-306b559cbe88" alt="The Options menu icon in GitBook"></picture> 并上下移动来重新排序。更改后的顺序会立即反映在你的网站上。

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

### 设置默认内容

如果你的网站中有多个部分，其中一个部分会被标记为 **默认**。当访客进入你的网站时，会显示该部分，并从你网站的根 URL 提供该内容。其他部分各自都有一个附加到根 URL 的 slug。

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

要将某个部分或变体设为默认，请点击 **操作菜单** <picture><source srcset="/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%2F89MTSo5XRpPMVr1T0rxS%2Factions.svg?alt=media&amp;token=2b5d001e-560a-4f29-8d22-de8163725ca1" alt="The Actions menu icon in GitBook"></picture> 在其表格行中的 **设为默认**.

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

### 从站点中移除内容

要从站点中移除一个部分或变体，请从 **站点结构** 在网站侧边栏中打开结构编辑器，并找到你想移除的内容。

打开 **操作菜单** <picture><source srcset="/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%2F89MTSo5XRpPMVr1T0rxS%2Factions.svg?alt=media&amp;token=2b5d001e-560a-4f29-8d22-de8163725ca1" alt="The Actions menu icon in GitBook"></picture> 以查看你想移除的内容，然后选择 **移除**.

{% hint style="success" %}
从你的网站中移除内容会将其从已发布网站中移除，但 **不会删除内容本身** ——你仍然可以在 [全部内容](/docs/documentation/zh/create-content/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 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/manage-your-site/site-structure.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.
