The example config in the 0.112.0 release notes and in the current version of the Hugo/Tailwind starter assumes a single CSS file located at the assets/css/ level. However, if I use a theme and have multiple CSS files in themes/[theme-name]/assets/css instead, what change should I make in the cachebusters setting for the CSS files?
The Hugo dev server’s --debug mode reports no cachebusters matches when I edit a template while using the following:
(Or, in a build.toml file, that presumably would be [[cachebusters]].)
I have found that the documented cachebusters setting works great for assets/css/*.css, but can’t seem to figure out how to adapt it for use in a theme-based directory structure. I also tried not putting the themes/[theme-name]/ part in the source setting, but that failed, too.
(These are uncommitted changes, due to other work I’m still doing in the repo; thus, there is no additional link I can provide at this time.)
Source will be relative to the component root even if it’s a theme – and it doesn’t matter where it’s mounted, so 'assets/css/foo.css` will be correct even if foo.css comes from a theme.
Target is always starting from the root assets folder, e.g. css/, but I would recommend that you define it a little more coarse grained, e.g just .*\\.css or maybe even just css which is a valid regexp that will match “anything css”.
A general tip is to run the server with hugo server --debug and see the relevant debug lines when you change a given file.
Thanks. Actually, I was already using --debug, as I noted. Have tried all of these combinations and I get no match with each when changing an .html template file:
I should note that this is not with the modules settings used in the example, because this project is not using Hugo Modules. However, I did the same non-modules config with that other project I mentioned, for the same reason, and all worked fine — although, to repeat, that project wasn’t using a theme.