> 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/creating-content/content-structure/page/tags.md).

# 标签

你可以使用标签来对相关内容进行分组、传达发布状态、标记过时内容，或以任何其他有助于读者浏览你的文档的方式使用。

{% hint style="info" %}
**注意：** 标签目前处于测试版，我们正在考虑添加更多功能——包括搜索功能和颜色支持。如果你希望标签具备某些特定功能，请 [在我们的 GitHub 社区中告诉我们](https://github.com/GitbookIO/community)!
{% endhint %}

## 为页面添加标签

打开页面，然后打开 **页面选项** ——可通过悬停在页面标题上访问——并添加一个或多个标签。你可以拖动标签来更改它们在页面上显示的顺序。

### 在页面上显示或隐藏标签

默认情况下，标签会显示在页面顶部。若要隐藏页面的标签，同时保留相关元数据：

* 打开 **页面选项**
* 关闭 **在页面上显示标签** 即可仅将标签保留为元数据

### 在目录中显示标签

对于每个页面，你都可以选择一个标签显示在 [目录](https://gitbook.com/docs/creating-content/content-structure/page#table-of-contents) ——就像你在此页面上看到的那样。要选择显示哪个标签：

* 打开 **页面选项**
* 在 **标签**，请使用 **在目录中显示** 下拉菜单选择你的标签。

## 为更新块添加标签

每个单独的 [更新块](/docs/documentation/zh/creating-content/blocks/updates.md) 也可以拥有自己的标签。

要为更新块添加标签，请转到该更新并点击 **添加标签** 在日期下方。然后你可以使用标签选择器来添加、移除或重新排序标签。

## 在资料库中管理标签

要查看、创建和管理你的空间的标签，请打开 **资源库** 来自 [目录](/docs/documentation/zh/creating-content/content-structure/page.md#table-of-contents) 并选择 **标签**.

每个标签都有：

* 一项 **标签** ——读者看到的内容
* 一项 **slug** ——一个稳定的标识符
* 一个可选的 **icon** 或 **表情符号**

## Markdown 中的标签

如果你使用 Git Sync，标签会出现在页面的 frontmatter 中。

```yaml
---
description: "标签是可重复使用的标记，你可以将其添加到页面和更新块中——本页将告诉你如何创建、添加和管理标签"
tags:
  - 新闻
  - 实验
  - 标签：beta
    primary: true
  - 专业版
---
```

标准标签使用字符串。

使用 `primary: true` 在一个标签上将其设为页面的主标签。GitBook 可以在目录中显示该标签。

GitBook 会保留列表中的标签顺序。


---

# 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/creating-content/content-structure/page/tags.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.
