> 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/guan-li-ni-de-zhan-dian/site-structure.md).

# 站点结构

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

你网站上的内容位于其 [部分](/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%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/guan-li-ni-de-zhan-dian/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/guan-li-ni-de-zhan-dian/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/guan-li-ni-de-zhan-dian/site-structure/site-sections.md)，点击 **添加部分** 表格下方的按钮，然后选择要添加的内容。新部分随后会添加到表格中，并作为你网站顶部的选项卡供访客使用。

要添加一个 [版本](/docs/documentation/zh/guan-li-ni-de-zhan-dian/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> 按钮来更改你想编辑的项目所在行。此时会打开一个弹窗。编辑你想更改的字段，然后点击 **保存** 按钮保存。

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

{% hint style="info" %}
slug 在你的整个组织内是唯一的——每个路径只能用于一个网站，即使跨不同网站也是如此。如果你看到“path is already taken”错误，说明另一个网站已经在使用该 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/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 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/guan-li-ni-de-zhan-dian/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.
