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

# 站点结构

你的网站内容存放在其 [区块中](/docs/documentation/zh/creating-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="/files/8c1112fe0dfefe229b2a53fe7d7299fb9fc71274">/files/8c1112fe0dfefe229b2a53fe7d7299fb9fc71274</a></td><td><a href="/files/3d0f0e6d0b070eb822d0b2fa89552e60555d880e">/files/3d0f0e6d0b070eb822d0b2fa89552e60555d880e</a></td><td><a href="/pages/d6842a8aab29e260bcaf1e0f07ac87c77eb8d47e">/pages/d6842a8aab29e260bcaf1e0f07ac87c77eb8d47e</a></td><td></td><td><a href="/files/a2606116bce287584b192bc5a38b5eb1fa757b50">/files/a2606116bce287584b192bc5a38b5eb1fa757b50</a></td></tr><tr><td><strong>内容变体</strong></td><td>发布同一内容的多个版本——非常适合本地化、版本管理等。</td><td><a href="/files/59cbe2e489533e054c107de5eb42203552141f2c">/files/59cbe2e489533e054c107de5eb42203552141f2c</a></td><td><a href="/files/66bf22917ed23903deb290aa7839d6b13a7e8be5">/files/66bf22917ed23903deb290aa7839d6b13a7e8be5</a></td><td><a href="/pages/8827b5487f591a8e224b6afeecca357a080c2852">/pages/8827b5487f591a8e224b6afeecca357a080c2852</a></td><td></td><td><a href="/files/f63c83ccc546a037ef537acb2b06510ed5174d1e">/files/f63c83ccc546a037ef537acb2b06510ed5174d1e</a></td></tr></tbody></table>

## 管理你的网站结构

通过管理你的网站结构，你也可以管理网站顶部导航栏。这个导航栏允许用户跳转到不同的区块和分组。

从以下位置打开结构编辑器 **站点结构**，位于 **常规** 在站点侧边栏中。在这里你可以看到网站的全部内容，并按区块和变体进行划分。

你的网站开始时会有一个区块，名称为你的网站名称，以及一个变体，内容为你在网站设置过程中创建的内容。

<figure><img src="/files/bb94519610a0b06e715f503a1ce96eecfd048c9b" alt="A GitBook screenshot showing a docs site&#x27;s structure"><figcaption><p>已发布文档站点的结构。</p></figcaption></figure>

### 向你的文档站点添加区块

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

要添加一个 [变体](/docs/documentation/zh/docs-site/site-structure/variants.md)，点击 **添加变体** 按钮，然后选择要添加的内容。新的变体随后会添加到所选区块中的变体列表里，并作为你网站变体下拉菜单中的一个选项供访问者使用。

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

### 更改区块或变体

<div data-full-width="false"><figure><img src="/files/29d579c521edfedf580d7a5c9878f655389ec628" 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="/files/ffffa8d3208c93af4ead7061897fa70e6d0d612f" alt="The Edit icon in GitBook"></picture> 按钮来更改每个区块和变体的名称与 slug。这将打开一个弹窗。编辑你想更改的字段，然后点击 **保存** 按钮进行保存。

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

要替换一个区块或变体，首先点击其 **编辑** <picture><source srcset="/files/kN09oTFtAuyaxNIwWuCt" media="(prefers-color-scheme: dark)"><img src="/files/ffffa8d3208c93af4ead7061897fa70e6d0d612f" alt="The Edit icon in GitBook"></picture> 按钮将其删除，然后点击弹窗左下角的 **删除** 按钮。一旦项目被删除，点击 **添加区块** 或 **添加变体** 按钮再次添加它。

### 重新排序区块或变体

你的网站会按照它们在你的 **站点结构** 表格中出现的顺序显示区块和变体。你可以抓住 **拖拽手柄** <picture><source srcset="/files/QLUQj6waZRiK6FpSqrt6" media="(prefers-color-scheme: dark)"><img src="/files/e1df373962dc4830bcb786d7e5cb3cce603367d3" 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="/files/d05670ba93b683794fb3fe95a9fc7ab5c7fceafd" 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="/files/d05670ba93b683794fb3fe95a9fc7ab5c7fceafd" alt="The Actions menu icon in GitBook"></picture> 你想移除的内容的 **移除**.

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