diff options
| -rw-r--r-- | layouts/partials/scripts.html | 9 | ||||
| -rw-r--r-- | layouts/shortcodes/form-search.html | 19 |
2 files changed, 20 insertions, 8 deletions
diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html index e931587..137cae2 100644 --- a/layouts/partials/scripts.html +++ b/layouts/partials/scripts.html @@ -1,17 +1,10 @@ {{- $vendors := slice -}} -{{- $vendorNames := slice "jquery.js" "lunr.js" -}} +{{- $vendorNames := slice "jquery.js" -}} {{- range $vendorNames -}} {{ $vendors = $vendors | append (resources.Get (printf "js/vendor/%s" .) ) }} {{- end -}} -{{- $vendors = $vendors | append (resources.Get "js/vendor/lunr.stemmer.support.js" ) -}} -{{- $lunrLangs := slice "de" "es" "fr" "it" "pt" "ru" -}} -{{- range $lunrLangs -}} - {{ $vendors = $vendors | append (resources.Get (printf "js/vendor/lunr.%s.js" .) ) }} -{{- end -}} -{{- $vendors = $vendors | append (resources.Get "js/vendor/lunr.multi.js" ) -}} - {{- $vendors = $vendors | resources.Concat "js/vendor-bundle.js" -}} {{- if or (eq (getenv "HUGO_ENV") "production") (eq site.Params.env "production") }} {{- $vendors = $vendors | minify -}} diff --git a/layouts/shortcodes/form-search.html b/layouts/shortcodes/form-search.html index 614ec35..e9a9175 100644 --- a/layouts/shortcodes/form-search.html +++ b/layouts/shortcodes/form-search.html @@ -19,6 +19,25 @@ {{- partial "search-results" . -}} +{{- $vendors := slice (resources.Get "js/vendor/lunr.js") -}} +{{- $vendors = $vendors | append (resources.Get "js/vendor/lunr.multi.js" ) -}} +{{- $vendors = $vendors | append (resources.Get "js/vendor/lunr.stemmer.support.js" ) -}} +{{- $lunrLangs := slice "de" "es" "fr" "it" "pt" "ru" -}} +{{- range $lunrLangs -}} + {{ $vendors = $vendors | append (resources.Get (printf "js/vendor/lunr.%s.js" .) ) }} +{{- end -}} + +{{- $vendors = $vendors | resources.Concat "js/lunr-bundle.js" -}} +{{- if or (eq (getenv "HUGO_ENV") "production") (eq site.Params.env "production") }} + {{- $vendors = $vendors | minify -}} +{{- end -}} +{{- if not site.Params.assets.disable_fingerprinting -}} + {{- $vendors = $vendors | fingerprint -}} + <script src="{{ $vendors.RelPermalink }}" integrity="{{ $vendors.Data.Integrity }}"></script> +{{- else -}} + <script src="{{ $vendors.RelPermalink }}"></script> +{{- end -}} + {{- $search := resources.Get "js/search.js" -}} {{- if or (eq (getenv "HUGO_ENV") "production") (eq site.Params.env "production") }} {{- $search = $search | minify -}} |
