mirror of
https://github.com/imfing/hextra.git
synced 2025-06-18 17:33:38 -04:00
fix: wrong SRI hash for katex.css (#702)
* Correct URL given in 'dev.toml' * stylesheet 'katex.css': fix SRI hash
This commit is contained in:

committed by
GitHub

parent
9c2a9f600b
commit
b43870a538
2
dev.toml
2
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
|
||||
|
@ -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 -}}
|
||||
<link rel="stylesheet" href="{{- .RelPermalink -}}" integrity="{{- . | fingerprint -}}" crossorigin="anonymous" />
|
||||
{{ $cssHash := . | fingerprint "sha512" -}}
|
||||
<link rel="stylesheet" href="{{- .RelPermalink -}}" integrity="{{- $cssHash.Data.Integrity -}}" crossorigin="anonymous" />
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
|
Reference in New Issue
Block a user