diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index 52e80fe..8f5cca8 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -211,8 +211,22 @@
}
})();
+
+{{- /* Search */}}
+{{- if (eq .Layout `search`) -}}
+
+{{- $fastsearch := resources.Get "js/fastsearch.js" | js.Build (dict "params" (dict "fuseOpts" site.Params.fuseOpts)) }}
+{{- $fusejs := resources.Get "js/fuse.basic.min.js" }}
+{{- if not site.Params.assets.disableFingerprinting }}
+{{- $search := (slice $fusejs $fastsearch ) | resources.Concat "assets/js/search.js" | minify | fingerprint }}
+
+{{- else }}
+{{- $search := (slice $fusejs $fastsearch ) | resources.Concat "assets/js/search.js" | minify }}
+
{{- end }}
+{{- else }}
+
{{- /* InstantClick.js */}}
{{- if (.Param "EnableInstantClick") }}
{{- $instantclick := slice (resources.Get "js/instantclick.js") | resources.Concat "assets/js/instantclick.js" | minify }}
@@ -221,3 +235,5 @@
>
{{- end }}
+
+{{- end -}}
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 99d33ae..a5dac53 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -58,20 +58,6 @@
{{- end }}
-{{- /* Search */}}
-{{- if (eq .Layout `search`) -}}
-
-{{- $fastsearch := resources.Get "js/fastsearch.js" | js.Build (dict "params" (dict "fuseOpts" site.Params.fuseOpts)) }}
-{{- $fusejs := resources.Get "js/fuse.basic.min.js" }}
-{{- if not site.Params.assets.disableFingerprinting }}
-{{- $search := (slice $fusejs $fastsearch ) | resources.Concat "assets/js/search.js" | minify | fingerprint }}
-
-{{- else }}
-{{- $search := (slice $fusejs $fastsearch ) | resources.Concat "assets/js/search.js" | minify }}
-
-{{- end }}
-{{- end -}}
-
{{- /* Highlight.js */}}
{{- $isHLJSdisabled := (site.Params.assets.disableHLJS | default .Params.disableHLJS ) }}
{{- if (and (eq .Kind "page") (ne .Layout "archives") (ne .Layout "search") (not $isHLJSdisabled)) }}