website/layouts/_default/search.json

18 lines
519 B
JSON
Raw Normal View History

2021-04-13 08:21:40 -05:00
{{ define "main" }}
{
2021-04-13 15:33:49 -05:00
{{ $mscratch := newScratch }}
{{ $mscratch.Add "articles" slice }}
{{ range .Site.RegularPages }}
{{ $mscratch.Add "articles" (dict
"title" .Title
"date" (.Date.Format "2006-01-02")
2021-06-16 04:08:07 -05:00
"tags" (sort (or .Params.tags slice))
2021-04-13 15:33:49 -05:00
"summary" .Summary
"text" (lower .Plain)
"link" .Permalink
"image" (or .Params.Image "")) }}
{{ end }}
"pages": {{ $mscratch.Get "articles" | jsonify }}
2021-04-13 08:21:40 -05:00
}
{{ end }}