aboutsummaryrefslogtreecommitdiffstats
path: root/layouts/_default/search.json
blob: 16912cb6bd2867dd96ded243b6f1b3d564b51190 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
{{ $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 -}}