Test site GitHub - tifenak-20/quicktest
Check hugo.toml, assets/css/syntax.css and partials/css.html (and post-1 if necessary after hugo server).
The syntax CSS is not added to public unless I remove the conditional argument.
Test site GitHub - tifenak-20/quicktest
Check hugo.toml, assets/css/syntax.css and partials/css.html (and post-1 if necessary after hugo server).
The syntax CSS is not added to public unless I remove the conditional argument.
Change this:
{{ partialCached "css.html" . }}
To this:
{{ partial "css.html" . }}
If I were you I’d split it into two partials, and place the conditional around the partial call, not within the partial itself.
In my project, I actually don’t use partialCached.
This solved it. Just placed the conditional in baseof.html.
A follow up question, does place the conditional around the partial call, not within the partial itself apply to every partial or mostly only those that call assets? E.g If I want to hide an author box, page meta, featured images, related pages etc? Coz I placed the conditional within these partials.
You seem to do so in the repo that you linked to.
Then my guidance is irrelevant. It would be helpful if the example you provide matches the actual setup.
That depends on the conditional check. For example, checking environment is appropriate within the partial because it applies to every page. But checking something that is page-specific must not be cached.
I was actually using that partial to test out some features and I never checked it had partialCached in the CSS. I cloned it to test the multiauthor setup.
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.