feat: make sure version hash for CSS files remains stable if content is the same
All checks were successful
Website build and deploy / build (push) Successful in 59s

This commit is contained in:
2026-03-31 17:27:49 +02:00
parent 80b4c2af5c
commit c5d35b7bc2

View File

@@ -13,9 +13,10 @@
<!-- Theme stylesheet, combination of all in assets/scss --> <!-- Theme stylesheet, combination of all in assets/scss -->
{{- $style := resources.Get "scss/main.scss" | resources.ExecuteAsTemplate "scss/main.scss" . | toCSS (dict "targetPath" "css/main.css" "enableSourceMap" false) }} {{- $style := resources.Get "scss/main.scss" | resources.ExecuteAsTemplate "scss/main.scss" . | toCSS (dict "targetPath" "css/main.css" "enableSourceMap" false) }}
<link rel="stylesheet" href="{{ ($style).RelPermalink }}?v={{ md5 time.Now.Unix }}"> <link rel="stylesheet" href="{{ ($style).RelPermalink }}?v={{ md5 $style.Content }}">
<!-- Custom CSS --> <!-- Custom CSS -->
{{- range .Site.Params.custom_css }} {{- range .Site.Params.custom_css }}
<link rel="stylesheet" href="{{ relURL . }}?v={{ md5 time.Now.Unix }}" /> {{- $md5 := md5 (readFile (printf "static/%s" .)) }}
<link rel="stylesheet" href="{{ relURL . }}?v={{ $md5 }}" />
{{- end }} {{- end }}