From b43870a538053cff1b5d110a7f51d9d21119dfcb Mon Sep 17 00:00:00 2001 From: Andreas Deininger Date: Wed, 11 Jun 2025 00:48:03 +0200 Subject: [PATCH] fix: wrong SRI hash for katex.css (#702) * Correct URL given in 'dev.toml' * stylesheet 'katex.css': fix SRI hash --- dev.toml | 2 +- layouts/_partials/head.html | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dev.toml b/dev.toml index 4d2f561..4bd0045 100644 --- a/dev.toml +++ b/dev.toml @@ -1,5 +1,5 @@ # Theme development config for exampleSite -# https://gohugo.io/getting-started/configuration/#configure-cache-busters +# https://gohugo.io/configuration/build/#cache-busters [build] [build.buildStats] enable = true diff --git a/layouts/_partials/head.html b/layouts/_partials/head.html index 8bc5b38..220b965 100644 --- a/layouts/_partials/head.html +++ b/layouts/_partials/head.html @@ -95,10 +95,11 @@ {{ with try (resources.GetRemote $katexCssUrl) -}} {{ with .Err -}} {{ errorf "Could not retrieve KaTeX css file from %s. Reason: %s." $katexCssUrl . -}} - {{ else with.Value -}} + {{ else with .Value -}} {{ $katexCssContent := strings.Replace .Content $katexFontPattern $katexFontSubstituted }} {{ with resources.FromString (printf "css/katex%s.css" (cond hugo.IsProduction ".min" "")) $katexCssContent -}} - + {{ $cssHash := . | fingerprint "sha512" -}} + {{ end -}} {{ end -}} {{ end -}}