diff options
author | Alex Shpak <alex-shpak@users.noreply.github.com> | 2021-05-19 20:26:21 +0200 |
---|---|---|
committer | Alex Shpak <alex-shpak@users.noreply.github.com> | 2021-05-19 20:26:21 +0200 |
commit | d7c644f0e7062bd847911bcfd9d9eaf401f3c36d (patch) | |
tree | 7b9d3c6d1587df722aebf271737ab9c5b1d82b7c /assets/search-data.json | |
parent | 843144dd85e374ade722e2f2b0b3511a0e34d8f6 (diff) |
Refactor search, prepare for pre-built indexing
Diffstat (limited to 'assets/search-data.json')
-rw-r--r-- | assets/search-data.json | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/assets/search-data.json b/assets/search-data.json new file mode 100644 index 0000000..9a137c3 --- /dev/null +++ b/assets/search-data.json @@ -0,0 +1,15 @@ +[ +{{- $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 }} +{{ if gt $index 0}},{{end}} { + "id": {{ $index }}, + "href": "{{ $page.RelPermalink }}", + "title": {{ (partial "docs/title" $page) | jsonify }}, + "section": {{ (partial "docs/title" $page.Parent) | jsonify }}, + "content": {{ $page.Plain | jsonify }} +} +{{- end -}} +] |