mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-13 22:16:02 +00:00
1 parent
eef72e8874
commit
d4a886ed2a
1 file changed
+12
@@ -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
|
### 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
|
```go-html-template
|
||||||
{{ $taxo := "tags" }} <!-- Use the plural form here -->
|
{{ $taxo := "tags" }} <!-- Use the plural form here -->
|
||||||
<ul id="{{ $taxo }}">
|
<ul id="{{ $taxo }}">
|
||||||
|
|||||||
Reference in new issue
Block a user