# Keywords
> 返回前置元数据中定义的关键词切片。
- 官方英文原文：https://gohugo.io/methods/page/keywords/
- 本页规范地址：https://hugozh.cn/methods/page/keywords/
- 最近更新：2026-10-02
- 最后提交：912b1d3 chore(site): 添加 static/CNAME（hugozh.cn），供 GitHub Pages 等平台绑定自定义域名
- 签名：PAGE.Keywords
- 返回类型：[]string
- 站点：Hugo 中文文档（https://hugozh.cn/）· 社区维护的非官方中文翻译，如有出入以官方英文原文为准

---
默认情况下，Hugo 在创建[相关内容][]集合时会用到关键词。

```toml
title = 'How to make spicy tuna hand rolls'
keywords = ['tuna','sriracha','nori','rice']
```

在模板中列出关键词：

```go-html-template
{{ range .Keywords }}
  {{ . }}
{{ end }}
```

或者使用 [`delimit`][] 函数：

```go-html-template
{{ delimit .Keywords ", " ", and " }} → tuna, sriracha, nori, and rice
```

关键词也可以用作一种有用的[分类法][]：

```toml
[taxonomies]
tag = 'tags'
keyword = 'keywords'
category = 'categories'
```

[`delimit`]: /functions/collections/delimit/
[相关内容]: /content-management/related-content/
[分类法]: /content-management/taxonomies/

