summaryrefslogtreecommitdiffstats
path: root/layouts/partials/scripts.html
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/partials/scripts.html')
-rw-r--r--layouts/partials/scripts.html20
1 files changed, 17 insertions, 3 deletions
diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html
index 8d51a70..1574f7e 100644
--- a/layouts/partials/scripts.html
+++ b/layouts/partials/scripts.html
@@ -1,11 +1,14 @@
{{- $vendors := slice -}}
-{{- $vendorNames := slice "jquery.min" -}}
+{{- $vendorNames := slice "jquery.js" "lunr.js" -}}
{{- range $vendorNames -}}
- {{ $vendors = $vendors | append (resources.Get (printf "js/vendor/%s.js" .) ) }}
+ {{ $vendors = $vendors | append (resources.Get (printf "js/vendor/%s" .) ) }}
{{- end -}}
-{{- $vendors := $vendors | resources.Concat "js/vendor-bundle.js" | minify -}}
+{{- $vendors = $vendors | resources.Concat "js/vendor-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 -}}
@@ -14,6 +17,17 @@
<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 -}}
+{{- 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 -}}
+
{{- with site.GoogleAnalytics -}}
{{- $ga := resources.Get "js/ga.js" | minify -}}
{{- if not site.Params.assets.disable_fingerprinting -}}