Hi, I want to define some default configuration and parameters in the theme, so that the users don’t need to tweak their site configuration after upgrading the theme. For example, postcss requires that:
Yes. You are doing it wrong Please post your whole configuration. In the most cases this is an issue with the order of those [sectionname] sections. The fact that you add an additional [build] and it miraculously works tells me that you have an issue with the order of those sections. Maybe the [build] is not in root, maybe it’s overridden somewhere along the line. TOML is quite rigid in regards to this. And Hugo offers so many ways to configure that you might overlook something.
If you have a config.toml in your root with a build section, this will override the one in config/production/config.toml. If you have a config/_default and a config/production putting something into production will work on the server, but not locally on hugo server (because locally it’s “development”, not “production”).
etc… etc… etc…
Either check your whole config or let us have a look at it.
I think that the _merge is only working from the place it is downwards, meaning if a module imports a module then the _merge is used. You as the user of a theme must have the upper hand in these settings, so having a theme override your local setup is not secure. I have the write stats setting in my own configuration on the root level at config/_default/build.toml with only
writeStats = false
in that file.
Then, the whole merge thing is a CAN not MUST feature. leave it out if you want it to work as default is set. See the docs here for defaults: