There is an inconsistency in how Hugo handles capitalized .Params.
Consider the following front matter parameter:
+++
sidebarName = "Introduction"
+++
The name sidebarName is handled differently in various cases:
{{ .Params.sidebarName }} // This works!
{{ .CurrentSection.Params.sidebarName }} // This does not work!
See also discussion here: https://discourse.gohugo.io/t/config-params-should-be-all-lowercase-or-not/5051/
As @bep wrote:
All config keys are stored as lower-case to be able to access them with any case.
But it seems if we access them via a section (or maybe other ways?), then this is not true.
Hugo version: v0.46/extended windows/amd64
It's a bug. I think it is registered before, but I haven't gotten time to look into it. It's probably time to do that now ... The thing is, when we made the params all lowercase (for good reason), it created some havoc, so I created an AST template transformer to make .Params.sidebarName into .Params.sidebarname.
Note that {{ .CurrentSection.Param "sidebarName" }} will work as expected.
Most helpful comment
It's a bug. I think it is registered before, but I haven't gotten time to look into it. It's probably time to do that now ... The thing is, when we made the params all lowercase (for good reason), it created some havoc, so I created an AST template transformer to make
.Params.sidebarNameinto.Params.sidebarname.Note that
{{ .CurrentSection.Param "sidebarName" }}will work as expected.