With the configuration:
[minify]
disableCSS = true
and the template:
{{- with . | minify | fingerprint }}
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
{{- end }}
the output filename still contains css.min.HASH.css, but the content is not minified. This creates a mismatch between naming and behavior, suggesting either the minify call should be honored or the filename should omit .min when CSS minification is disabled.
The issue surfaced because I need to preserve the exact hsl() value in both an inline style and visible text:
~~```html
hsl(61,100%,50%)
```~~
Full CSS minification converts hsl() to hex, so I rely on disableCSS to prevent that. This also disables minification in partials, revealing the inconsistent filename behavior.
Related info: How to set minify css not to convert rgba to hex #9794
Try with:
{{- with . | fingerprint }}
2 Likes
When you pass a resource through the resource.Minify function it minimizes the resource, using the site configuration options that correspond to the resource’s media type (e.g., minify.tdewolff.css.precision).
The top level minify configuration keys affect both inline code the behavior of the resource.Minify function. For example, if you set disableCSS = true then this will not be minified:
<style>
html {
box-sizing: border-box;
font-family: sans-serif;
font-size: 16px;
line-height: 1.5;
scroll-behavior: smooth;
}
</style>
1 Like
This is not what I meant. The HSL information is additional, not the problem, but it causes confusion.
What I want to say is the same as title Filename Includes .min When disableCSS Prevents Actual Minification: the minify function generates a *.min.* file, but it is not actually minified if the minify option is disabled. However, as @jmooring mentioned, this is expected behavior because it minifies based on the config file.