Fix #482 - ToCSS

Use toCSS alias.
Based upon https://gohugo.io/functions/css/sass/
This commit is contained in:
TheGroundZero 2024-09-04 07:08:38 +00:00 committed by GitHub
parent a902dacd84
commit 1546e90987
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -22,9 +22,19 @@
{{ end }} {{ end }}
<!-- CSS --> <!-- CSS -->
{{ $options := (dict "targetPath" "main.css" "outputStyle" "compressed" "enableSourceMap" true) }} {{ with resources.Get "sass/main.scss" }}
{{ $style := resources.Get "scss/main.scss" | resources.ToCSS $options | resources.Fingerprint }} {{ $opts := dict "targetPath" "main.css" "outputStyle" "compressed" "enableSourceMap" true }}
<link rel="stylesheet" href="{{ $style.RelPermalink }}" integrity="{{ $style.Data.Integrity }}"> {{ with . | toCSS $opts }}
{{ if hugo.IsDevelopment }}
<link rel="stylesheet" href="{{ .RelPermalink }}">
{{ else }}
{{ with . | minify | fingerprint }}
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ range $val := $.Site.Params.customCSS }} {{ range $val := $.Site.Params.customCSS }}
{{ if gt (len $val) 0 }} {{ if gt (len $val) 0 }}