Hugo configuration
I'm using Hugo to render this site, slightly self harming but using Emacs org-mode for the templates instead of Markdown. There are some things that I've found confusing that might help somone else.
Being a bit anal I've split up my configuration into different files. It doesn't make much sense to do so for a small site like mine but it's possible and who knows, one day I might have plenty of pages and even want to have a staging environment.
In the documentation for the configuration they make it sound kind of simple, and they do indeed mention
When splitting the configuration by root key, omit the root key in the component file.
However, it seems like it's also a lot less forgiving when splitting. In my original global configuration file I had this:
[menu]
[[menu.main]]
identifier = "about"
name = "About"
url = "/about/"
weight = 10
[[menu.main]]
identifier = "contact"
name = "Contact"
url = "/contact/"
weight = 10It worked just fine, I had my menu and it looked ok. However, when I created the file config/_default/menu.toml and
moved the content there, I was greeted with the following
failed to decode "menus": unable to cast maps.Params{"main":[]interface {}{map[string]interface {}{"identifier":"about", "name":"About", "url":"/about/", "weight":10}, map[string]interface {}{"identifier":"contact", "name":"Contact", "url":"/contact/", "weight":10}}} of type maps.Params to []interface{}
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)I smacked my forhead and removed the [[menu]], still getting the same. Because it should be menus.toml and there should be no outer. So in the end to make it work I have
[[main]]
identifier = "about"
name = "About"
url = "/about/"
weight = 10
[[main]]
identifier = "contact"
name = "Contact"
url = "/contact/"
weight = 10And it's now working. The same goes for all the files you put there, my configuration currently looks like:
config/
└── _default
├── base.toml
├── hugo.toml
├── markup.toml
├── menus.toml
├── minify.toml
├── privacy.toml
└── taxonomies.tomlConsidering they're containing very few things, this is pretty pointless as one file will still give you a good overview but I'll keep it like this for now. This exercise was mainly to understand how it's working and getting familiar with Hugo configuration.