hugo-theme-contentful/layouts/_default/list.json

26 lines
1.3 KiB
JSON
Raw Normal View History

2019-09-20 16:11:12 +00:00
{
"version": "https://jsonfeed.org/version/1",
"title": "{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}",
"home_page_url": "{{ .Site.BaseURL }}",
"feed_url": "{{ with .OutputFormats.Get "json" }}{{ .Permalink }}{{ end }}",
"description": "Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}",
"favicon": "{{ "assets/icon.png" | absURL }}",
"icon": "{{ "assets/icon.png" | absURL }}",
2020-05-11 15:59:06 +00:00
{{- with .Site.Author }}
2019-09-20 16:11:12 +00:00
"author": {
2020-05-11 15:59:06 +00:00
"name": "{{ .name }}"
{{- with .email }},
"url": "mailto:{{ . }}"
{{ end }}
2019-09-20 16:11:12 +00:00
},
2020-05-11 15:59:06 +00:00
{{- end }}
2019-09-20 16:11:12 +00:00
"items":
{{- $limit := cond (gt .Site.Params.feedLimit 0) .Site.Params.feedLimit 10 -}}
2020-05-11 15:59:06 +00:00
{{- $pages := first $limit (where .Site.RegularPages "Params.date" "!=" nil) -}}
2019-09-20 16:11:12 +00:00
{{- $.Scratch.Add "index" slice -}}
{{- range $pages -}}
2020-05-11 15:59:06 +00:00
{{- $.Scratch.Add "index" (dict "id" .Permalink "url" .Permalink "title" .Title "summary" .Summary "content_html" .Content "tags" .Params.tags "date_published" (.Date.Format "2006-01-02T15:04:05Z07:00" | safeHTML) "date_modified" ( .Lastmod.Format "2006-01-02T15:04:05Z07:00" | safeHTML ) ) -}}
2019-09-20 16:11:12 +00:00
{{- end -}}
{{- $.Scratch.Get "index" | jsonify -}}
2020-05-11 15:59:06 +00:00
}