jlelse
/
Indieroad
Archived
1
Fork 0
This commit is contained in:
Jan-Lukas Else 2019-10-21 20:16:35 +02:00
parent d2aacf1894
commit 928ad9213b
1 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,32 @@
{{- $pctx := . -}}
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
{{- $pages := $pctx.RegularPages -}}
{{- $limit := .Site.Config.Services.RSS.Limit -}}
{{- if ge $limit 1 -}}
{{- $pages = $pages | first $limit -}}
{{- end -}}
{
"version": "https://jsonfeed.org/version/1",
"title": "{{ .Site.Title }}",
"description": "{{ .Site.Params.description }}",
"home_page_url": "{{ .Permalink}}",
"feed_url": "{{ .Permalink }}feed.json",
"author": {
"name": "{{ .Site.Author.name }}",
"url": "{{ .Site.Author.link }}"
},
"items": [
{{ range $index, $pages := $pages }}
{{ if ge $index 1 }}, {{end}}{
"id": "{{ .Permalink }}",
"url": "{{ .Permalink }}",
"title": {{ .Title | jsonify }},
"content_html": {{ .Content | jsonify }},
"summary": {{ .Summary | jsonify }},
"date_published": {{ dateFormat "2006-01-02T15:04:05-07:00" .Date | jsonify }},
"date_modified": {{ dateFormat "2006-01-02T15:04:05-07:00" .Lastmod | jsonify }},
"tags": {{ .Params.Tags | jsonify }}
}
{{ end }}
]
}