Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/h-enk/doks.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/assets
diff options
context:
space:
mode:
authorJames Elliott <james-d-elliott@users.noreply.github.com>2022-06-25 06:36:32 +0300
committerJames Elliott <james-d-elliott@users.noreply.github.com>2022-06-25 06:36:32 +0300
commitb532c69bd769353490e412e22d790e484aeb91dc (patch)
tree47fa882d474625b89149cf3fbab4f46861f3beef /assets
parentfa01f4ab56541a5acc954f04cc48c67ffa2772ee (diff)
feat: add all method
Diffstat (limited to 'assets')
-rw-r--r--assets/js/index.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/assets/js/index.js b/assets/js/index.js
index 2f47890..0c2de5d 100644
--- a/assets/js/index.js
+++ b/assets/js/index.js
@@ -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) -}}