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
All checks were successful
Website build and deploy / build (push) Successful in 59s
This commit is contained in:
@@ -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 }}
|
||||||
|
|||||||
Reference in New Issue
Block a user