From 1546e90987fbc05e9afb31b45a120e5d21f94cd8 Mon Sep 17 00:00:00 2001 From: TheGroundZero <2406013+TheGroundZero@users.noreply.github.com> Date: Wed, 4 Sep 2024 07:08:38 +0000 Subject: [PATCH] Fix #482 - ToCSS Use toCSS alias. Based upon https://gohugo.io/functions/css/sass/ --- layouts/partials/head.html | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 5e239e0..839c902 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -22,9 +22,19 @@ {{ end }} -{{ $options := (dict "targetPath" "main.css" "outputStyle" "compressed" "enableSourceMap" true) }} -{{ $style := resources.Get "scss/main.scss" | resources.ToCSS $options | resources.Fingerprint }} - +{{ with resources.Get "sass/main.scss" }} + {{ $opts := dict "targetPath" "main.css" "outputStyle" "compressed" "enableSourceMap" true }} + {{ with . | toCSS $opts }} + {{ if hugo.IsDevelopment }} + + {{ else }} + {{ with . | minify | fingerprint }} + + {{ end }} + {{ end }} + {{ end }} +{{ end }} + {{ range $val := $.Site.Params.customCSS }} {{ if gt (len $val) 0 }} @@ -74,4 +84,4 @@ {{- if $.Site.Params.plausibleDataDomain }} -{{- end}} \ No newline at end of file +{{- end}}