Skip to content

Commit

Permalink
Add Page.GetTerms
Browse files Browse the repository at this point in the history
Fixes #6905
  • Loading branch information
bep committed Feb 19, 2020
1 parent eef72e8 commit d4a886e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions content/en/templates/taxonomy-templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,18 @@ Because we are leveraging the front matter system to define taxonomies for conte

### Example: List Tags in a Single Page Template

{{< new-in "0.65.0" >}}

```go-html-template
<ul>
{{ range (.GetTerms "tags") }}
<li><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></li>
{{ end }}
</ul>
```

Before Hugo 0.65.0 you needed to do something like this:

```go-html-template
{{ $taxo := "tags" }} <!-- Use the plural form here -->
<ul id="{{ $taxo }}">
Expand Down

0 comments on commit d4a886e

Please sign in to comment.