someone
1
In config.yaml
:
taxonomies:
category: categories
In content/blog/en/test.md
:
title: Taxonomies Test
catagories:
- network-tcp
In themes/xxx/layouts/_default/list.html
:
{{ range .Site.Taxonomies }} <!-- or site.Taxonomies -->
{{ . }}
{{ end }}
What it renders:
map[]
How do I list all catagories
?
First, use either “categories” or “catagories”, but not both.
Second, see examples:
https://gohugo.io/variables/taxonomy/#access-taxonomy-data-from-any-template
Sorry catagories
was a typo, I have fixed it. But nothing changed.
categories:
- network-tcp
{{ range .Site.Taxonomies }}
{{ . }}
{{ end }}
{{ .Site.Taxonomies | jsonify }}
{{ range site.Taxonomies }}
{{ . }}
{{ end }}
{{ site.Taxonomies | jsonify }}
Still renders
map[]
{"categories":{}}
map[]
{"categories":{}}
OK it is because
disableKinds:
- taxonomy
- terms
I thought it was to disable pages.
system
Closed
5
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.