> 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/publish/publish-a-docs-site/public-publishing.md).

# 公开发布

将你的文档公开发布到网络上，让每个人都可以访问

如果您为公众创建了文档，可以将其发布到网上。发布到网上的空间可被搜索引擎编入索引，任何人都可以访问。如果您不希望搜索引擎将您的内容编入索引，也可以禁用此功能——请在 [下文](#publish-as-public).

了解更多。无论您以何种方式发布内容，您仍然可以控制哪些人能够 *编辑* 您的内容。并且，只有您的主内容分支会被发布，因此任何 [更改请求](https://gitbook.com/docs/documentation/zh/collaborate/change-requests.md) 在合并之前都会保持私密。

### 作为公开内容发布

要在网上公开发布文档，请前往要发布的文档站点，点击 **发布** 按钮，然后选择 **公开** 选项。

### **发布但不进行搜索引擎索引**

默认情况下，您的站点会被搜索引擎编入索引。您也可以选择禁用此功能——这意味着网上所有人仍然可以访问这些文档，但它们 *不会* 被 Google 等搜索引擎编入索引。

要更改此设置，请打开您网站的 **设置 → 受众**。在访问选项（**公开访问**, **分享链接**和 **身份验证访问**）下方，使用 **搜索引擎索引** 下拉菜单，选择是否允许搜索引擎为您的网站编入索引。

任何拥有你文档链接的人仍然可以访问它们。如果你想发布文档的测试版，或者进行大规模用户测试，同时又不想因为可能重复的内容影响你的 SEO，那么不被索引的文档站点会特别有帮助。

### 页面级搜索索引控制

你还可以在单个页面级别控制搜索索引。GitBook 提供两种搜索索引控制类型：

#### 内部搜索索引

控制页面是否会被 GitBook 的内部搜索引擎和 Ask AI 功能索引。这会影响：

* 在你的 GitBook 区块内搜索内容
* Ask AI 引用页面内容的能力

**外部搜索索引（网络爬虫）**

控制搜索引擎和网络爬虫（Google、ChatGPT 等）是否可以索引你的页面。这会影响：

* 通过搜索引擎获得的 SEO 和可发现性
* 网络爬虫访问你的内容

#### **层级继承行为**

**搜索索引设置遵循层级继承模式：**

* **父页面控制**：在父页面上禁用搜索索引后，其下的所有子页面也会自动禁用索引。
* **子页面无法覆盖此设置**：如果父页面已禁用搜索索引，子页面就无法重新启用该功能。
* **级联效果**：此设置会沿整个页面层级产生级联效果——在顶级页面上停用索引，会使整个版块都停用索引。

这种层级行为可确保相关内容区块之间保持一致的索引策略，并防止原本应在区块内保持私密的内容被意外公开。

{% hint style="info" %}
此功能适用于 [Essential 和 Ultimate 站点方案](https://www.gitbook.com/pricing).
{% 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/publish/publish-a-docs-site/public-publishing.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.
