It would be helpful if the “–verbose” flag caused Hugo to say something like, “Hey, I’m going to ignore this section in your configuration file. It’s valid TOML but you need to add it to a [Params] section if you want to use it.”
I ran across this tonight. I wanted to add a flag to control some text in my footer. It took me a while to puzzle out why it wasn’t working.
If I want to add information on the author, I add this to the config.toml
file.
[author]
name = "michael d henderson"
If I want to add a parameter “skin” that tracks a value, the following won’t work:
[skin]
show_generated_by = true
Instead, I have to add
[Params.skin]
show_generated_by = true
It’s late and it took me a few times through the documentation to figure out that .Site.Author is special, so Hugo will accept [author]
and do nice things with it. Having gone through this once, I probably won’t make the same mistake many more times. But, having gone through it, it’s frustrating to track down.
The other option would be to automatically add the sections to .Params, but that could be even more confusing (see my earlier post about .Site.Params.Author vs .Site.Author).