feat(style): add integrity check

This commit is contained in:
Hanwen Guo 2023-01-01 17:14:50 +08:00
parent 6c52934e93
commit 4bacdfcb75

View File

@ -15,7 +15,7 @@
<link rel="shortcut icon" type="image/x-icon" href="{{ $.Site.Params.favicon | relURL }}" />
{{ $options := (dict "outputStyle" "compressed" "enableSourceMap" (not hugo.IsProduction)) }}
{{ $sass := resources.Get "css/main.scss" }}
{{ $style := $sass | resources.ToCSS $options }}
<link rel="stylesheet" href="{{ $style.Permalink | relURL }}" />
{{ $style := $sass | resources.ToCSS $options | resources.Fingerprint "sha512" }}
<link rel="stylesheet" href="{{ $style.Permalink | relURL }}" integrity="{{ $style.Data.Integrity }}" />
{{ if .Params.mathjax }} {{ partial "mathjax.html" . }} {{ end }}
</head>