X-Git-Url: https://www.kengrimes.com/gitweb/?p=kengrimes.com%2Ftheme.git;a=blobdiff_plain;f=layouts%2F_default%2Fsingle.json;fp=layouts%2F_default%2Fsingle.json;h=f4f1c34723b29917d999d977862bd79f0e39584d;hp=0000000000000000000000000000000000000000;hb=f0a30e2f91a75e945d891d5bb95b4b90b75202bc;hpb=3a03bebcc0264e37e178addb6475c72341bef004 diff --git a/layouts/_default/single.json b/layouts/_default/single.json new file mode 100644 index 0000000..f4f1c34 --- /dev/null +++ b/layouts/_default/single.json @@ -0,0 +1,41 @@ +{{ $iconRoot := cond (not $.Params.iconroot) "" $.Params.iconroot }} +{{- $sp := .Site.GetPage "section" .Section }} +{{- $sh := cond (or (not $sp.Params.header) (not (fileExists (printf "static/%s" $sp.Params.header)))) (cond (or (not .Site.Home.Params.header) (not (fileExists (printf "static/%s" .Site.Home.Params.header)))) "/img/speedy.png" .Site.Home.Params.header) $sp.Params.header }} +{{- $ph := cond (or (not .Params.header) (not (fileExists (printf "static/%s" .Params.header)))) $sh .Params.header }} +{ + "version" : "https://jsonfeed.org/version/1", + "title" : "{{ .Site.Title }} :: {{ .Title }}", + "description" : "{{ if not .Description }}{{ .Title }}{{ else }}{{ .Description }}{{ end }}", + "home_page_url": "{{ .Site.BaseURL }}", + "feed_url": "{{ .Site.BaseURL }}/index.json", + "icon" : "{{ printf `%s%s` .Site.BaseURL $ph }}", + "favicon" : "{{ printf `%s%s/favicon-32x32.png` .Site.BaseURL $iconRoot }}", + {{- with .Site.Author }} + "author" : { + "name" : "{{ .name }}", + "url" : "{{ .url }}", + "avatar" : "{{ .avatar }}" + }, + {{- end }} + "items" : [ + { + "title" : {{ jsonify .Title }}, + "date_published" : "{{ .Date }}", + {{- if not .Lastmod }} + "date_modified" : "{{ .Date }}", + {{- else }} + "date_modified" : "{{ .Lastmod }}", + {{- end }} + "id" : "{{ .Permalink }}", + "url" : "{{ .Permalink }}", + {{- with .Params.author }} + "author" : { + "name" : "{{ . }}" + }, + {{- end }} + "content_html" : {{ jsonify .Content }}, + "summary" : {{ jsonify .Summary }}, + "tags" : {{ jsonify .Params.tags }} + } + ] +}