Don't secure assets on localhost; it just messes with the JS debugger

This commit is contained in:
Eryn Wells 2023-02-04 18:26:32 -08:00
parent 94a09d0c81
commit 4f4312b944

View file

@ -1,5 +1,9 @@
{{ $asset := dict }}
{{ with resources.Get . }}
{{ $asset = dict "Resource" . "Secure" (. | resources.Fingerprint "md5") }}
{{ $secureAsset := . }}
{{ if not (in (site.BaseURL | string) "localhost") }}
{{ $secureAsset = $secureAsset | resources.Fingerprint "md5" }}
{{ end }}
{{ $asset = dict "Resource" . "Secure" $secureAsset }}
{{ end }}
{{ return $asset }}