🐛 Fix: cdn script loading failure

This commit is contained in:
Cell
2023-12-08 00:55:17 +08:00
parent c783ced12f
commit 94a1796e63
+2 -2
View File
@@ -6,7 +6,6 @@
{{- else -}}
{{- $src := .Source -}}
{{- $integrity := .Integrity -}}
{{- $attrs := "" -}}
{{- if $src | and (not (urls.Parse $src).Host) -}}
{{- $resource := resources.Get $src -}}
{{- with .Template -}}
@@ -23,9 +22,10 @@
{{- $integrity = $resource.Data.Integrity -}}
{{- end -}}
{{- with $resource.RelPermalink -}}
{{- $attrs = printf `src="%v"` . | add $attrs -}}
{{- $src = $resource.RelPermalink -}}
{{- end -}}
{{- end -}}
{{- $attrs := printf `src="%v"` $src -}}
{{- if .Crossorigin -}}
{{- $attrs = ` crossorigin="anonymous"` | add $attrs -}}
{{- end -}}