aboutsummaryrefslogtreecommitdiff
path: root/assets/search-data.js
diff options
context:
space:
mode:
Diffstat (limited to 'assets/search-data.js')
-rw-r--r--assets/search-data.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/assets/search-data.js b/assets/search-data.js
index f324281..a93664e 100644
--- a/assets/search-data.js
+++ b/assets/search-data.js
@@ -16,8 +16,11 @@
const index = FlexSearch.create('balance', indexCfg);
window.bookSearchIndex = index;
- {{ range $index, $page := where .Site.Pages "Kind" "in" (slice "page" "section") }}
- {{ if $page.Content }}
+ {{- $pages := where .Site.Pages "Kind" "in" (slice "page" "section") -}}
+ {{- $pages = where $pages "Params.booksearchexclude" "!=" true -}}
+ {{- $pages = where $pages "Content" "not in" (slice nil "") -}}
+
+ {{ range $index, $page := $pages }}
index.add({
'id': {{ $index }},
'href': '{{ $page.RelPermalink }}',
@@ -26,5 +29,4 @@
'content': {{ $page.Plain | jsonify }}
});
{{- end -}}
- {{- end -}}
})();