1 {{ $iconRoot := cond (not $.Params.iconroot) "" $.Params.iconroot }}
2 {{- $sp := .Site.GetPage "section" .Section }}
3 {{ $secIcon := cond (or (not $sp.Params.header) (not (fileExists (printf "static/%s" $sp.Params.header)))) "/img/speedy.png" $sp.Params.header }}
5 "version" : "https://jsonfeed.org/version/1",
6 "title" : "{{ .Site.Title }} :: {{ .Title }}",
7 "description" : "{{ if not .Description }}{{ .Title }}{{ else }}{{ .Description }}{{ end }}",
8 "home_page_url": "{{ .Site.BaseURL }}",
9 "feed_url": "{{ .Site.BaseURL }}/index.json",
10 "icon" : "{{ printf `%s%s` .Site.BaseURL $secIcon }}",
11 "favicon" : "{{ printf `%s%s/favicon-32x32.png` .Site.BaseURL $iconRoot }}",
12 {{- with .Site.Author }}
14 "name" : "{{ .name }}",
16 "avatar" : "{{ .avatar }}"
20 {{- $pages := .Pages.ByPublishDate.Reverse }}
21 {{- $length := (len $pages) }}
22 {{- range $index, $element := $pages }}
23 {{- $ph := cond (or (not .Params.header) (not (fileExists (printf "static/%s" .Params.header)))) (cond (or (not .Parent.Params.header) (not (fileExists (printf "static/%s" .Parent.Params.header)))) "/img/speedy.png" .Parent.Params.header) .Params.header }}
25 "title" : {{ jsonify .Title }},
26 "date_published" : "{{ .Date }}",
27 {{- if not .Lastmod }}
28 "date_modified" : "{{ .Date }}",
30 "date_modified" : "{{ .Lastmod }}",
32 "id" : "{{ .Permalink }}",
33 "url" : "{{ .Permalink }}",
34 {{- with .Params.author }}
39 "content_html" : {{ jsonify .Content }},
40 "summary" : {{ jsonify .Summary }},
41 "tags" : {{ jsonify .Params.tags }}
42 }{{ if ne (add $index 1) $length }},