Hi all, raising here since I’m not certain whether its a bug or expected behavior.
I recently updated to v0.112.0
(not on .1
yet) and redid my Tailwind implementation to follow the new cache busting methods. I use partialCached
to insert my CSS code into the <head>
element of my template to keep things cleaner and I’ve noticed that sometimes Hugo now renders the resulting css file as this:
<link href="__h_pp_l1_1_RelPermalink__e=" rel="stylesheet" />
instead of a link to the actual file. If I change partialCached
to just partial
it all works fine. The partial snippet looks like this:
{{/* styles */}}
{{ $options := dict "inlineImports" true }}
{{ $styles := resources.Get "css/styles.css" }}
{{ $styles = $styles | resources.PostCSS $options }}
{{ $styles = $styles | minify | fingerprint | resources.PostProcess }}
<link href="{{ $styles.RelPermalink }}" rel="stylesheet" />
I’ve created a reproduction repo here GitHub - jloh/hugo-partial-cache-bug-2023
If you run hugo server
and browse around you’ll see that it sometimes doesn’t render the CSS file as expected. Its worth noting this bug appears to only be present with hugo server
and just running hugo
to generate the HTML does not result in it.
Again updating the partial to not be cached also fixes the problem for me.
Thanks so much for the updated Tailwind experience! Apart from this its been fantastic.