#242, Add bookSearchExclude frontmatter param
This commit is contained in:
@@ -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 -}}
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user