Here is a working solution, with json files for all taxonomies being created:
config.json
,
"outputs": {
"taxonomyTerm": ["html", "json"]
}
layouts/_default/terms.json
{{- $.Scratch.Add "index" slice -}}
{{- range $index, $element := .Data.Pages.ByTitle -}}
{{- $.Scratch.Add "index" (dict "id" $index "name" $element.Name "link" $element.Permalink) -}}
{{- end -}}
{{- $.Scratch.Get "index" | jsonify -}}
The big confusion for me at least is that taxonomyTerm
is the list of the terms in the taxonomy and the taxonomy
is a term in the taxonomy.
using Hugo Static Site Generator v0.70.0