2021-04-13 08:21:40 -05:00
|
|
|
{{ define "main" }}
|
|
|
|
{
|
2021-04-13 15:33:49 -05:00
|
|
|
{{ $mscratch := newScratch }}
|
|
|
|
{{ $mscratch.Add "articles" slice }}
|
2021-12-25 07:59:08 -06:00
|
|
|
{{ $pages := where .Site.RegularPages "Params.nosearch" "!=" "true" }}
|
|
|
|
{{ range $pages }}
|
2022-10-24 01:02:44 -05:00
|
|
|
{{ $image := "" }}
|
|
|
|
{{ if .Params.Image }}
|
|
|
|
{{ if or (hasPrefix .Params.Image "/") (hasPrefix .Params.Image "http://") (hasPrefix .Params.Image "https://") }}
|
|
|
|
{{ $image = .Params.Image }}
|
|
|
|
{{ else }}
|
|
|
|
{{ $image = path.Join "/" (path.Join .File.Dir .Params.Image) }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
2021-04-13 15:33:49 -05:00
|
|
|
{{ $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))
|
2022-04-02 10:28:19 -05:00
|
|
|
"summary" (or .Params.description .Summary)
|
2021-04-13 15:33:49 -05:00
|
|
|
"text" (lower .Plain)
|
|
|
|
"link" .Permalink
|
2022-10-24 01:16:12 -05:00
|
|
|
"image" $image
|
|
|
|
"imageAlt" (or .Params.Alt "")) }}
|
2021-04-13 15:33:49 -05:00
|
|
|
{{ end }}
|
|
|
|
"pages": {{ $mscratch.Get "articles" | jsonify }}
|
2021-04-13 08:21:40 -05:00
|
|
|
}
|
|
|
|
{{ end }}
|