Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/h-enk/doks.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/partials/footer/script-footer.html')
-rw-r--r--layouts/partials/footer/script-footer.html13
1 files changed, 13 insertions, 0 deletions
diff --git a/layouts/partials/footer/script-footer.html b/layouts/partials/footer/script-footer.html
new file mode 100644
index 0000000..739a7ae
--- /dev/null
+++ b/layouts/partials/footer/script-footer.html
@@ -0,0 +1,13 @@
+{{ $lazysizes := resources.Get "js/vendor/lazysizes/lazysizes.min.js" -}}
+{{ if eq (hugo.Environment) "development" -}}
+ {{ $alpinejs := resources.Get "js/vendor/alpinejs/alpine.js" -}}
+ {{ $app := resources.Get "js/app.js" -}}
+ {{ $js := slice $alpinejs $lazysizes $app | resources.Concat "main.js" -}}
+ <script src="{{ $js.Permalink }}" defer></script>
+{{ else -}}
+ {{ $alpinejs := resources.Get "js/vendor/alpinejs/alpine.js" | minify -}}
+ {{ $app := resources.Get "js/app.js" | minify -}}
+ {{ $js := slice $alpinejs $lazysizes $app | resources.Concat "main.js" -}}
+ {{ $secureJS := $js | resources.Fingerprint "sha512" -}}
+ <script src="{{ $secureJS.Permalink }}" integrity="{{ $secureJS.Data.Integrity }}" crossorigin="anonymous" defer></script>
+{{ end -}} \ No newline at end of file