2020-04-15 15:48:16 +02:00
|
|
|
{{ $lazysizes := resources.Get "js/vendor/lazysizes/lazysizes.min.js" -}}
|
|
|
|
{{ if eq (hugo.Environment) "development" -}}
|
|
|
|
{{ $app := resources.Get "js/app.js" -}}
|
2020-04-16 08:38:41 +02:00
|
|
|
{{ $js := slice $lazysizes $app | resources.Concat "main.js" -}}
|
2020-04-15 15:48:16 +02:00
|
|
|
<script src="{{ $js.Permalink }}" defer></script>
|
|
|
|
{{ else -}}
|
|
|
|
{{ $app := resources.Get "js/app.js" | minify -}}
|
2020-04-16 08:38:41 +02:00
|
|
|
{{ $js := slice $lazysizes $app | resources.Concat "main.js" -}}
|
2020-04-15 15:48:16 +02:00
|
|
|
{{ $secureJS := $js | resources.Fingerprint "sha512" -}}
|
|
|
|
<script src="{{ $secureJS.Permalink }}" integrity="{{ $secureJS.Data.Integrity }}" crossorigin="anonymous" defer></script>
|
|
|
|
{{ end -}}
|