> 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/seo.md).

# SEO

GitBook 会自动处理大部分 SEO。已发布站点具有响应式设计、预渲染，并通过全球 CDN 提供服务，你几乎无需额外配置。

### GitBook 会自动完成的事项

#### 响应式设计

已发布的内容会适配各种屏幕尺寸，包括手机、平板电脑和桌面设备。

#### URL 和元数据

* 默认情况下，页面 URL 根据页面标题生成，但可以自定义。
* 规范 URL 可避免重复内容问题。
* HTML 标题和 Open Graph 标题取自页面标题和站点标题。
* Meta 描述和 Open Graph 描述取自页面描述。
* 图片支持替代文本，这有助于搜索引擎优化和无障碍访问。
* HTML 会在服务器端预渲染，因此爬虫无需运行 JavaScript 即可为你的内容编入索引。

{% hint style="info" %}
GitBook 不会生成关键词元标签。现代搜索引擎不会将其用于排名—— [Google 已于 2009 年证实这一点](https://developers.google.com/search/blog/2009/09/google-does-not-use-keywords-meta-tag).
{% endhint %}

#### 站点地图

对于任何未设为不公开的已发布站点，GitBook 都会自动生成站点地图。要找到它，请在站点首页 URL 后添加 `/sitemap-pages.xml` ——例如， [gitbook.com/docs/sitemap-pages.xml](https://gitbook.com/docs/sitemap-pages.xml).

#### CDN 和缓存

所有已发布的内容都会缓存，并通过全球 CDN 提供。更快的加载速度既能改善用户体验，也有助于提升搜索排名。

### 你可以采取的措施

#### 设置自定义域名

自定义域名，例如 `docs.example.com` 与 `yourorganization.gitbook.io` 子域名相比，可能有助于提升搜索可见度。设置自定义域名 →

#### 加快编入索引的速度

GitBook 无法控制搜索引擎为你的内容编入索引的速度，但以下两种方法可能有所帮助：

1. 从已编入索引的页面链接到你的站点。Google 重新抓取这些页面时，更有可能发现你的站点。
2. 直接向 Google 提交你的站点。这需要使用自定义域名，并通过 TXT DNS 记录验证所有权。 [向 Google 提交你的站点 →](https://developers.google.com/search/docs/advanced/crawling/ask-google-to-recrawl)

#### 设置重定向

将内容迁移到 GitBook 或调整站点结构，可能会导致现有链接失效并影响 SEO。设置 [重定向](https://gitbook.com/docs/documentation/zh/publish/site-redirects.md) → 将旧 URL 转发到新 URL。

移动或重命名页面时，GitBook 会自动创建一条 [HTTP 307 重定向](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/307) 将旧 URL 重定向到新 URL。 [详细了解自动重定向 →](https://gitbook.com/docs/documentation/zh/publish/site-redirects.md#about-automatic-redirects)


---

# 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/seo.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.
