diff options
Diffstat (limited to 'layouts/_default/search.json')
-rw-r--r-- | layouts/_default/search.json | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/layouts/_default/search.json b/layouts/_default/search.json new file mode 100644 index 0000000..16912cb --- /dev/null +++ b/layouts/_default/search.json @@ -0,0 +1,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 -}} |