hugo-theme-zzo/layouts/index.json

8 lines
472 B
JSON

{{ .Scratch.Delete "searchindex" }}
{{- $.Scratch.Add "searchindex" slice -}}
{{- range $index, $element := (where .Site.RegularPages "Kind" "page") -}}
{{ with $element.Plain }}
{{- $.Scratch.Add "searchindex" (dict "id" $index "title" $element.Title "uri" $element.Permalink "tags" $element.Params.tags "section" $element.Section "content" $element.Plain "description" $element.Description) -}}
{{ end }}
{{- end -}}
{{- $.Scratch.Get "searchindex" | jsonify -}}