Cannot display content for a taxonomy term that includes a dash


  • “sci-fi”

{{ range first 2 .Site.Taxonomies.topics.sci-fi }}

Returns empty template with following error message
ERROR: 2016/12/13 04:37:48 template.go:477: template: taxonomy/category.html:337: bad character U+002D ‘-’

Anyone know why this wouldnt work?

This is a limitation of the Go templates, try:

{{ range first 2 (index .Site.Taxonomies.topics "sci-fi") }}
1 Like