Update head.html

Based on https://gohugo.io/hugo-pipes/transpile-sass-to-css/
This commit is contained in:
TheGroundZero 2024-09-04 08:09:34 +00:00 committed by GitHub
parent 1546e90987
commit 09f5539451
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -22,17 +22,9 @@
{{ end }} {{ end }}
<!-- CSS --> <!-- CSS -->
{{ with resources.Get "sass/main.scss" }} {{ $opts := dict "transpiler" "libsass" "targetPath" "main.css" "outputStyle" "compressed" "enableSourceMap" true }}
{{ $opts := dict "targetPath" "main.css" "outputStyle" "compressed" "enableSourceMap" true }} {{ with resources.Get "scss/main.scss" | toCSS $opts | minify | fingerprint }}
{{ with . | toCSS $opts }} <link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
{{ 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 }} {{ end }}