I’m having an issue where what I’m hoping will be an ID shows up as a class.
My list.html
:
{{define "main"}}
{{ range $index, $element := sort .Pages "Params.priority" "asc" }}
{{$color := "white"}}
{{if (modBool $index 2)}}
{{$color = "white"}}
{{else}}
{{$color = "color-block"}}
{{end}}
{{if (isset .Params "bgcolor")}}
{{$color = "red"}}
{{end}}
<div id="{{.Params.title}}" class="outer-section {{.Params.bgcolor}}">
...
</div>
{{ end }}
{{end}}
One of the content files’ frontmatter:
---
title: "hero"
priority: 1
draft: false
homepage: true
header: false
titleAlign: center
textAlign: center
hero: true
bgcolor: color-block
---
Resulting tag:
<div class="outer-section hero">
...
</div>