From 76d7db7b4c3514cebfd1631a2fdb29234b400221 Mon Sep 17 00:00:00 2001 From: James Elliott Date: Sat, 25 Jun 2022 21:54:54 +1000 Subject: [PATCH] feat: handle homepage for search sections show --- layouts/partials/footer/script-footer.html | 2 +- layouts/partials/header/header.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/partials/footer/script-footer.html b/layouts/partials/footer/script-footer.html index 1a571d1..7240b00 100644 --- a/layouts/partials/footer/script-footer.html +++ b/layouts/partials/footer/script-footer.html @@ -40,7 +40,7 @@ {{ $flexSearch := resources.Get "js/vendor/flexsearch/dist/flexsearch.bundle.js" -}} {{ $slice = $slice | append $flexSearch -}} {{ if and (isset .Site.Params.options "searchsectionsshow") (not (eq .Site.Params.options.searchSectionsShow "ALL")) -}} - {{ $showFlexSearch = or (eq (len .Site.Params.options.searchSectionsShow) 0) (in .Site.Params.options.searchSectionsShow .Section) -}} + {{ $showFlexSearch = or (eq (len .Site.Params.options.searchSectionsShow) 0) (in .Site.Params.options.searchSectionsShow .Section) (and .IsHome (in .Site.Params.options.searchSectionsShow "HomePage")) -}} {{ end -}} {{ end -}} diff --git a/layouts/partials/header/header.html b/layouts/partials/header/header.html index 77c24de..d6e0f6e 100644 --- a/layouts/partials/header/header.html +++ b/layouts/partials/header/header.html @@ -80,7 +80,7 @@ {{- $showFlexSearch := .Site.Params.options.flexSearch }} {{- if $showFlexSearch }} {{- if and (isset .Site.Params.options "searchsectionsshow") (not (eq .Site.Params.options.searchSectionsShow "ALL")) }} - {{- $showFlexSearch = or (eq (len .Site.Params.options.searchSectionsShow) 0) (in .Site.Params.options.searchSectionsShow .Section) }} + {{- $showFlexSearch = or (eq (len .Site.Params.options.searchSectionsShow) 0) (in .Site.Params.options.searchSectionsShow .Section) (and .IsHome (in .Site.Params.options.searchSectionsShow "HomePage")) }} {{- end }} {{- end }}