hacker.tours-website/themes/zen/layouts/partials/scripts.html
2024-06-13 22:14:05 +02:00

61 lines
2.4 KiB
HTML

{{ $opts := dict "minify" true -}}
{{ if eq hugo.Environment "development" -}}
{{ $opts = merge $opts (dict "minify" false) -}}
{{ end -}}
{{ $early := resources.Get "js/script-early.js" | js.Build $opts | fingerprint -}}
<script src="{{ $early.RelPermalink }}"></script>
{{ if $.Param "alpine" -}}
{{ $alpine := resources.Get "libs/alpine.min.js" | fingerprint -}}
<script defer src="{{ $alpine.RelPermalink }}"></script>
{{ end -}}
{{ if $.Param "jquery" -}}
{{ $jquery := resources.Get "libs/jquery.slim.min.js" | fingerprint -}}
<script defer src="{{ $jquery.RelPermalink }}"></script>
{{ end -}}
{{ if $.Param "umbrella" -}}
{{ $umbrella := resources.Get "libs/umbrella.min.js" | fingerprint -}}
<script defer src="{{ $umbrella.RelPermalink }}"></script>
{{ end -}}
{{ if $.Param "mobilemenu" -}}
{{ $mobilemenu := resources.Get "js/mobile.js" | js.Build $opts | fingerprint -}}
<script defer src="{{ $mobilemenu.RelPermalink }}"></script>
{{ end -}}
{{ if $.Param "cookieconsent" -}}
{{ $cookieconsent := resources.Get "js/cookieconsent.js" | js.Build $opts | fingerprint -}}
<script defer src="{{ $cookieconsent.RelPermalink }}"></script>
{{ end -}}
{{ if $.Param "listsort" -}}
{{ $listmin := resources.Get "libs/list.min.js" | fingerprint -}}
<script defer src="{{ $listmin.RelPermalink }}"></script>
{{ $listsort := resources.Get "js/listsort.js" | fingerprint -}}
<script defer src="{{ $listsort.RelPermalink }}"></script>
{{ end -}}
{{ if $.Param "tables" -}}
{{ $tables := resources.Get "js/tables.js" | js.Build $opts | fingerprint -}}
<script defer src="{{ $tables.RelPermalink }}"></script>
{{ end -}}
{{ if .HasShortcode "contact" -}}
{{ $contact := resources.Get "js/contact.js" | js.Build $opts | fingerprint -}}
<script defer src="{{ $contact.RelPermalink }}"></script>
{{ end -}}
{{ if .HasShortcode "search" -}}
{{ $flexsearch := resources.Get "libs/flexsearch.compact.js" | fingerprint -}}
<script defer src="{{ $flexsearch.RelPermalink }}"></script>
{{ $search_opts := merge $opts (dict "params" (dict "searchLimit" (site.Params.searchLimit | default 20) "basePath" site.Home.RelPermalink)) -}}
{{ $search := resources.Get "js/search.js" | js.Build $search_opts | fingerprint -}}
<script defer src="{{ $search.RelPermalink }}"></script>
{{ end -}}
{{ $script := resources.Get "js/script.js" | js.Build $opts | fingerprint -}}
<script defer src="{{ $script.RelPermalink }}"></script>