jlelse
/
Indiego
Archived
1
Fork 0
This repository has been archived on 2020-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Indiego/layouts/_default/list.jsonfeed.json

39 lines
1.4 KiB
JSON

{{- $pctx := . -}}
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
{{- $pages := slice -}}
{{- if eq $.Kind "taxonomyTerm" -}}
{{- $pages = $pctx.Pages -}}
{{- else -}}
{{- $pages = $pctx.RegularPages -}}
{{- end -}}
{{- $limit := .Site.Config.Services.RSS.Limit -}}
{{- $postSections := ($.Param "postSections" | default (slice "posts")) }}
{{- $pages := ( where $pages "Type" "in" $postSections ) }}
{{- 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": {{ partialCached "cleanedContent.json" . .Permalink }},
"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 }}
]
}