summaryrefslogtreecommitdiffstats
path: root/layouts/shortcodes/form-search.html
diff options
context:
space:
mode:
authorSerghei Iakovlev <egrep@protonmail.ch>2022-07-06 01:33:06 +0200
committerSerghei Iakovlev <egrep@protonmail.ch>2022-07-06 01:33:06 +0200
commit756c9bc45f0732db6e0ca553c82bc378aab30dee (patch)
tree022d1344c7301bdf51e4058c2ee968f95797204a /layouts/shortcodes/form-search.html
parent638903353764fbcfc44b19f1d444d3b8060bcaa2 (diff)
downloadgohugo-theme-ed-756c9bc45f0732db6e0ca553c82bc378aab30dee.tar.gz
Remove jQuery dependency from search form
Diffstat (limited to 'layouts/shortcodes/form-search.html')
-rw-r--r--layouts/shortcodes/form-search.html11
1 files changed, 11 insertions, 0 deletions
diff --git a/layouts/shortcodes/form-search.html b/layouts/shortcodes/form-search.html
index cb30d6f..614ec35 100644
--- a/layouts/shortcodes/form-search.html
+++ b/layouts/shortcodes/form-search.html
@@ -18,3 +18,14 @@
</div>
{{- partial "search-results" . -}}
+
+{{- $search := resources.Get "js/search.js" -}}
+{{- if or (eq (getenv "HUGO_ENV") "production") (eq site.Params.env "production") }}
+ {{- $search = $search | minify -}}
+{{- end -}}
+{{- if not site.Params.assets.disable_fingerprinting -}}
+ {{- $search = $search | fingerprint -}}
+ <script src="{{ $search.RelPermalink }}" integrity="{{ $search.Data.Integrity }}"></script>
+{{- else -}}
+ <script src="{{ $search.RelPermalink }}"></script>
+{{- end -}}