Can code with conditionals be partialCached?

For example, layouts/partials/head/styles.html

{{- $options := dict "inlineImports" true }}
{{- $styles := resources.Get "css/styles.css" }}
{{- $styles = $styles | resources.PostCSS $options }}
{{- if hugo.IsProduction }}
  {{- $styles = $styles | minify | fingerprint }}
{{- end -}}

If you pass the conditional as an additional parameter – probably. Personally, I always minify and fingerprint, even in development. But then my CSS and my site are small.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.