This repository has been archived on 2022-12-03. You can view files and clone it, but cannot push or open issues or pull requests.
public-web/layouts/home.searchindex.json

5 lines
492 B
JSON

{{- $.Scratch.Add "searchindex" slice -}}
{{- range $index, $element := where site.RegularPages "Params.exclude_search" nil -}}
{{- $.Scratch.Add "searchindex" (dict "id" $index "title" $element.Title "permalink" $element.RelPermalink "tags" (delimit ($element.Params.tags | default "") " ") "content" $element.Plain "summary" $element.Summary "date" ($element.Date.Format ($.Param "dateformat" | default "2 January, 2006"))) -}}
{{- end -}}
{{- $.Scratch.Get "searchindex" | jsonify -}}