--minify doesn't minify

The commandline minify option doesn’t work on css here, neither this

{{ $styles := resources.Get “css/main.css” | minify }}

nor on this

{{ (resources.Get "css/home_specific.css" | minify).Content }}

So I have both the commandline option and the explicit calls, but the output is not minified. Did I miss something ?

Use resources.Minify , as per documentation
so

{{ $styles := resources.Get “css/main.css” | resources.Minify }}

I did read the documentation.

Alias
minify

So it shouldn’t be necessary. And the commandline option should work too.

The --minify flags minifies the HTML files written to /public.

{{ $styles := resources.Get “css/main.css” | minify }}
{{ $styles.Content }} => minifed
{{ $styles.RelPermalink }} => minified

The above is very well tested, so you need to tell us what you mean by “not minified”.

the following is index.html (homepage), as is, with the newlines and indentations, which shouldn’t be there.

<style>@layer home{body {grid-template-columns: 15% 1fr}
	figcaption {line-height:initial;font-size:2rem; font-family: "norse"}
	h1+label {visibility:collapse}
	p {font-size: clamp(16px, 2.2vw,20px);}
	p:first-of-type {margin-top:0}
	p:last-of-type {
		display: table;
		color:gold; text-align:center;
		padding: 0 1dvw; margin:0;
		border: medium dashed red;}
	article header {display:none}
	@media (width <= 350px) {
		figure {display:none}
	}
}</style><input type=checkbox id=showtoc>
<input type=checkbox id=showmenu><nav aria-labelledby="Primary navigation"><header role=banner><a title="Lien ramenant vers la page d'accueil" href=/><img alt="Logo du site" src=/Images/history/symboles_site/brand_symbol.webp width=300 height=139>

This is a known limitation with the @layer rule:
https://github.com/tdewolff/minify/issues/651

I see. no problem, I shouldn’t have to wait too long, and it’s mostly aesthetic anyway :+1:

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