# GetTerms
> 返回给定页面在指定分类法中定义的术语所对应的术语页集合，顺序与它们在前置元数据中出现的先后一致。
- 官方英文原文：https://gohugo.io/methods/page/getterms/
- 本页规范地址：https://hugozh.cn/methods/page/getterms/
- 最近更新：2026-10-02
- 最后提交：912b1d3 chore(site): 添加 static/CNAME（hugozh.cn），供 GitHub Pages 等平台绑定自定义域名
- 签名：PAGE.GetTerms TAXONOMY
- 返回类型：page.Pages
- 站点：Hugo 中文文档（https://hugozh.cn/）· 社区维护的非官方中文翻译，如有出入以官方英文原文为准

---
给定如下前置元数据：

```toml
title = 'Les Misérables'
tags = ['historical','classic','fiction']
```

这段模板代码：

```go-html-template
{{ with .GetTerms "tags" }}
  <p>Tags</p>
  <ul>
    {{ range . }}
      <li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
    {{ end }}
  </ul>
{{ end }}
```

会渲染为：

```html
<p>Tags</p>
<ul>
  <li><a href="/tags/historical/">historical</a></li>
  <li><a href="/tags/classic/">classic</a></li>
  <li><a href="/tags/fiction/">fiction</a></li>
</ul>
```

