{{- $.Scratch.Add "index" slice -}}
{{ $posts := (where (.Site.RegularPages) "Type" "in" .Site.Params.searchTypes) }}
{{- range $posts  -}}
    {{- $.Scratch.Add "index" (dict "title" .Title "tags" .Params.tags "categories" .Params.categories "contents" .Plain "permalink" .Permalink) -}}
{{- end -}}
{{- $.Scratch.Get "index" | jsonify -}}