Use custom output format for search index

This commit is contained in:
Will Faught
2024-04-07 19:03:01 -07:00
parent 19a794b82f
commit 99cce27a59
5 changed files with 11 additions and 5 deletions

View File

@@ -0,0 +1,17 @@
{{- $page := . -}}
{{- $page.Scratch.Add "paige_index" slice -}}
{{- range where site.RegularPages "Params.paige.search.hide_page" "ne" true -}}
{{- $page.Scratch.Add "paige_index" (dict
"categories" .Params.categories
"date" .PublishDate
"description" (.Description | markdownify | plainify | htmlUnescape)
"keywords" .Params.keywords
"link" .RelPermalink
"tags" .Params.tags
"text" (strings.TrimRight " " (replace (.Plain | htmlUnescape) "\n" " "))
"title" (.Title | markdownify | plainify | htmlUnescape)) -}}
{{- end -}}
{{- $page.Scratch.Get "paige_index" | jsonify -}}