Fingerprint CSS

This commit is contained in:
Christian Wolf 2025-01-21 19:22:47 +01:00
parent 189d7e8123
commit bc1123dcea

View File

@ -13,6 +13,7 @@
{{ with .Keywords }}<meta name="keywords" content="{{ delimit . "," "," }}">{{ end }} {{ with .Keywords }}<meta name="keywords" content="{{ delimit . "," "," }}">{{ end }}
{{ $options := (dict "targetPath" "main.css" "outputStyle" "compressed" "enableSourceMap" (not hugo.IsProduction) "transpiler" "dartsass") }} {{ $options := (dict "targetPath" "main.css" "outputStyle" "compressed" "enableSourceMap" (not hugo.IsProduction) "transpiler" "dartsass") }}
{{ $scss := resources.Get "css/main.scss" | css.Sass $options }} {{ $scss := resources.Get "css/main.scss" | css.Sass $options }}
{{ if hugo.IsProduction }}{{ $scss = $scss | minify | fingerprint }}{{ end }}
<link rel="stylesheet" type="text/css" href="{{ $scss.RelPermalink }}" /> <link rel="stylesheet" type="text/css" href="{{ $scss.RelPermalink }}" />
{{ $title := print .Site.Title " | " .Title }} {{ $title := print .Site.Title " | " .Title }}
{{ if .IsHome }}{{ $title = .Site.Title }}{{ end }} {{ if .IsHome }}{{ $title = .Site.Title }}{{ end }}