Short version:
Can I set “built:publishResources” to false for an entire site (in hugo.toml / config.toml)?
Long version:
For my site, I need every page to have
build:
publishResources: false
in its front matter. I would have thought I could have achieved this by placing:
[build]
publishResources = false
into config.toml (or hugo.toml for sites with updated naming). but alas, it doesn’t work.
Is there something else I can do to get this behavior? (or is there something I am doing wrong)
I assume that once I can make this work in the site config file, I can put it into the theme config file. Indeed, one of my experiments was to try:
[build]
_merge = "deep"
publishResources = false
into hugo.toml in my theme
One workaround (based on Build options not working - #3 by jmooring ) is to put something into the _index for the site root:
cascade:
build:
publishResources: false
This seems to work, but I would prefer to be able to address in the configuration file.
Thanks in advance!
irkode
September 20, 2025, 8:12pm
2
no, build options are front matter keys.
1 Like
You can Cascade down from the site configuration.
1 Like
Hmmm. This sounds promising. Is there something that explains it?
I tried:
[[cascade]]
[build]
publishResources = false
in my config file, but it didn’t seem to work.
Thanks!
The TOML needs to look like this:
[[cascade]]
[cascade.build]
publishResources = false
In YAML like this:
cascade:
- build:
publishResources: true
1 Like
This is great! Thank you.
It works great in the site configuration!
I would like to make it work in the theme configuration. (which is still a mystery to me). I wonder if this is a “_merge” issue ( Introduction ) - or is it that there is something that means that I cannot do this in a theme configuration.
Ideally, I would be able to set this in the theme, and not have to modify each site. But that might be asking for too much…
In your project config, you can do this:
[cascade]
_merge = 'deep'
But only if the cascade config is a single map instead of a slice of maps. See https://github.com/gohugoio/hugo/issues/13869 .
That means your theme config needs to look like this:
[cascade.build]
publishResources = false
Instead of this:
[[cascade]]
[cascade.build]
publishResources = false