mirror of
https://github.com/13hannes11/hugo-coder-timeline.git
synced 2024-09-04 00:50:58 +02:00
Add missing integrity attributes (#520)
* Verify minified dark-mode.js integrity * Verify forkawesome-webfont.woff2 integrity * Use pipes to fingerprint forkawesome-webfont.woff2
This commit is contained in:
committed by
GitHub
parent
36514f2542
commit
501a5bcbc4
@@ -22,7 +22,9 @@
|
||||
<link rel="canonical" href="{{ .Permalink }}">
|
||||
{{ end }}
|
||||
|
||||
<link rel="preload" href="/fonts/forkawesome-webfont.woff2?v=1.1.7" as="font" type="font/woff2" crossorigin>
|
||||
{{ $fa := resources.Get "fonts/forkawesome-webfont.woff2" }}
|
||||
{{ $faFingerprint := $fa | fingerprint }}
|
||||
<link rel="preload" href="{{ $fa.RelPermalink }}?v=1.1.7" as="font" type="font/woff2" integrity="{{ $faFingerprint.Data.Integrity }}" crossorigin>
|
||||
|
||||
{{ if .Site.IsServer }}
|
||||
{{ $cssOpts := (dict "targetPath" "css/coder.css" "enableSourceMap" true ) }}
|
||||
@@ -118,7 +120,7 @@
|
||||
<script src="{{ $script.RelPermalink }}"></script>
|
||||
{{ else }}
|
||||
{{ $script := resources.Get "js/dark-mode.js" | minify | fingerprint }}
|
||||
<script src="{{ $script.RelPermalink }}"></script>
|
||||
<script src="{{ $script.RelPermalink }}" integrity="{{ $script.Data.Integrity }}"></script>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user