{{ $dateFormat := .Site.Params.dateFormat | default "Jan 2, 2006" }} {{- $.Scratch.Add "index" slice -}} {{- range (where .Site.RegularPages "Type" "in" .Site.Params.mainSections) -}} {{- $.Scratch.Add "index" (dict "title" .Title "tags" .Params.tags "categories" .Params.categories "contents" (.Summary | plainify) "date" (.Date.Format $dateFormat) "permalink" .Permalink) -}} {{- end -}} {{- $.Scratch.Get "index" | jsonify -}}