Loading assets/js/index.js +6 −2 Original line number Diff line number Diff line Loading @@ -95,11 +95,15 @@ Source: // https://discourse.gohugo.io/t/range-length-or-last-element/3803/2 {{ $list := slice }} {{- if or (not (isset .Site.Params.options "searchsectionsindex")) (eq (len .Site.Params.options.searchSectionsIndex) 0) }} {{- $list = (where .Site.Pages "Section" "docs") }} {{- if and (isset .Site.Params.options "searchsectionsindex") (not (eq (len .Site.Params.options.searchSectionsIndex) 0)) }} {{- if eq .Site.Params.options.searchSectionsIndex "ALL" }} {{- $list = .Site.Pages }} {{- else }} {{- $list = (where .Site.Pages "Type" "in" .Site.Params.options.searchSectionsIndex) }} {{- end }} {{- else }} {{- $list = (where .Site.Pages "Section" "docs") }} {{- end }} {{ $len := (len $list) -}} Loading layouts/partials/footer/script-footer.html +1 −1 Original line number Diff line number Diff line Loading @@ -39,7 +39,7 @@ {{ if $showFlexSearch -}} {{ $flexSearch := resources.Get "js/vendor/flexsearch/dist/flexsearch.bundle.js" -}} {{ $slice = $slice | append $flexSearch -}} {{ if (isset .Site.Params.options "searchsectionsshow") -}} {{ 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) -}} {{ end -}} {{ end -}} Loading layouts/partials/header/header.html +1 −1 Original line number Diff line number Diff line Loading @@ -79,7 +79,7 @@ {{- $showFlexSearch := .Site.Params.options.flexSearch }} {{- if $showFlexSearch }} {{- if (isset .Site.Params.options "searchsectionsshow") }} {{- 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) }} {{- end }} {{- end }} Loading Loading
assets/js/index.js +6 −2 Original line number Diff line number Diff line Loading @@ -95,11 +95,15 @@ Source: // https://discourse.gohugo.io/t/range-length-or-last-element/3803/2 {{ $list := slice }} {{- if or (not (isset .Site.Params.options "searchsectionsindex")) (eq (len .Site.Params.options.searchSectionsIndex) 0) }} {{- $list = (where .Site.Pages "Section" "docs") }} {{- if and (isset .Site.Params.options "searchsectionsindex") (not (eq (len .Site.Params.options.searchSectionsIndex) 0)) }} {{- if eq .Site.Params.options.searchSectionsIndex "ALL" }} {{- $list = .Site.Pages }} {{- else }} {{- $list = (where .Site.Pages "Type" "in" .Site.Params.options.searchSectionsIndex) }} {{- end }} {{- else }} {{- $list = (where .Site.Pages "Section" "docs") }} {{- end }} {{ $len := (len $list) -}} Loading
layouts/partials/footer/script-footer.html +1 −1 Original line number Diff line number Diff line Loading @@ -39,7 +39,7 @@ {{ if $showFlexSearch -}} {{ $flexSearch := resources.Get "js/vendor/flexsearch/dist/flexsearch.bundle.js" -}} {{ $slice = $slice | append $flexSearch -}} {{ if (isset .Site.Params.options "searchsectionsshow") -}} {{ 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) -}} {{ end -}} {{ end -}} Loading
layouts/partials/header/header.html +1 −1 Original line number Diff line number Diff line Loading @@ -79,7 +79,7 @@ {{- $showFlexSearch := .Site.Params.options.flexSearch }} {{- if $showFlexSearch }} {{- if (isset .Site.Params.options "searchsectionsshow") }} {{- 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) }} {{- end }} {{- end }} Loading