Initial Commit
[ancientarts.git] / hugo / themes / ancientarts / layouts / _default / list.json
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 }}
4 {
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 }}
13 "author" : {
14 "name" : "{{ .name }}",
15 "url" : "{{ .url }}",
16 "avatar" : "{{ .avatar }}"
17 },
18 {{- end }}
19 "items" : [
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 }}
24 {
25 "title" : {{ jsonify .Title }},
26 "date_published" : "{{ .Date }}",
27 {{- if not .Lastmod }}
28 "date_modified" : "{{ .Date }}",
29 {{- else }}
30 "date_modified" : "{{ .Lastmod }}",
31 {{- end }}
32 "id" : "{{ .Permalink }}",
33 "url" : "{{ .Permalink }}",
34 {{- with .Params.author }}
35 "author" : {
36 "name" : "{{ . }}"
37 },
38 {{- end }}
39 "content_html" : {{ jsonify .Content }},
40 "summary" : {{ jsonify .Summary }},
41 "tags" : {{ jsonify .Params.tags }}
42 }{{ if ne (add $index 1) $length }},
43 {{ end }}
44 {{- end }}
45 ]
46 }