CSS update requires changing hugo.toml?

I have found by trial and error that after updating cusom CSS (using hugo-book theme) the change is not rendered unless I modify and change hugo.toml. Starting the server with

hugo server --disableFastRender

does not change this behavior. More precisely, I update assets/_codeblock.scss and this is included in assets/_custom.scss. The change might involve changing the background color of codeblocks, for example, using pre.chroma tag. Sometimes I must delete browsing data in Google Chrome to see the change, but this is rarely the case.

maybe this one helps:

1 Like

Thanks, I tried inserting the [build] options suggested by bep, but it makes no difference. Updating a CSS file does not trigger an execution of the pipeline. This might be due to
the way the hugo-book theme is designed.

just found that one related to themes munts an cachbusters…with nice explanation

so hugo version plays a role…and maybe hugo stats… and ofc your setup

2 Likes

I am a step further in my “investigation”. I have the feeling that it’s the use of @import vs @use in my SCSS that makes recent Sass versions ignore updates. Running my Sass system inside of Hugo results in a CSS file, outside of Hugo it fails with plenty of issues. I am reworking that and we’ll see if the Hugo server is updating then when I change files. It might be an issue in SASS instead of Hugo.

Ok, so I tried source = 'assets/.*\\.sccs', but it did not help.

There is some talk on that page about hugo server --debug, but
when I try this with hugo version 0.40.2 is fails complaining that --debug
is an unknown flag.

Changing @import to @use only caused more issues.
This is probably a theme issue.

The theme I’m using (hugo-book) places scss files in assets, but it seems Hugo takes assets/css as “root”. Copying the scss files to assets/css fixes the problem, provided this
is added to hugo.toml:

[build]
  [[build.cachebusters]]
    source = 'scss'
    target = 'css'