feat(assets): add SRI config for stylesheet and script
This commit is contained in:
@@ -25,16 +25,18 @@
|
||||
{{- with $CDN.fontawesomeFreeCSS -}}
|
||||
{{- . | safeHTML -}}
|
||||
{{- else -}}
|
||||
{{- $res := resources.Get "lib/fontawesome-free/all.min.css" | resources.Fingerprint "sha256" -}}
|
||||
<link rel="stylesheet" href="{{ $res.RelPermalink }}" integrity="{{ $res.Data.Integrity }}">
|
||||
{{- $res := resources.Get "lib/fontawesome-free/all.min.css" -}}
|
||||
{{- $stylesheet := (dict "resource" $res "fingerprint" ($scratch.Get "fingerprint")) -}}
|
||||
{{- partial "plugin/stylesheet.html" $stylesheet -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Animate.css */ -}}
|
||||
{{- with $CDN.animateCSS -}}
|
||||
{{- . | safeHTML -}}
|
||||
{{- else -}}
|
||||
{{ $res := resources.Get "lib/animate/animate.min.css" | resources.Fingerprint "sha256" -}}
|
||||
<link rel="stylesheet" href="{{ $res.RelPermalink }}" integrity="{{ $res.Data.Integrity }}">
|
||||
{{- $res := resources.Get "lib/fontawesome-free/all.min.css" -}}
|
||||
{{- $stylesheet := (dict "resource" $res "fingerprint" ($scratch.Get "fingerprint")) -}}
|
||||
{{- partial "plugin/stylesheet.html" $stylesheet -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* style.min.css */ -}}
|
||||
@@ -43,5 +45,6 @@
|
||||
{{- $options = dict "includePaths" (slice "config/css") | merge $options -}}
|
||||
{{- $options = dict "outputStyle" "compressed" | merge $options -}}
|
||||
{{- $options = dict "enableSourceMap" true | merge $options -}}
|
||||
{{- $res = resources.ExecuteAsTemplate "style.scss" . $res | toCSS $options | resources.Fingerprint "sha256" -}}
|
||||
<link rel="stylesheet" href="{{ $res.RelPermalink }}" integrity="{{ $res.Data.Integrity }}">
|
||||
{{- $res = resources.ExecuteAsTemplate "style.scss" . $res | toCSS $options -}}
|
||||
{{- $stylesheet := (dict "resource" $res "fingerprint" ($scratch.Get "fingerprint")) -}}
|
||||
{{- partial "plugin/stylesheet.html" $stylesheet -}}
|
||||
|
||||
Reference in New Issue
Block a user