xmitter-11ty/feed/json.njk

32 lines
1018 B
Plaintext
Raw Normal View History

2019-10-30 14:26:42 -04:00
---
# Metadata comes from _data/metadata.json
permalink: "{{ metadata.jsonfeed.path }}"
2019-10-30 14:26:42 -04:00
---
{
2020-11-30 22:04:23 -05:00
"version": "https://jsonfeed.org/version/1.1",
2019-10-30 14:26:42 -04:00
"title": "{{ metadata.title }}",
"language": "{{ metadata.language }}",
2019-10-30 14:26:42 -04:00
"home_page_url": "{{ metadata.url }}",
"feed_url": "{{ metadata.jsonfeed.url }}",
"description": "{{ metadata.description }}",
"author": {
"name": "{{ metadata.author.name }}",
"url": "{{ metadata.author.url }}"
},
"items": [
{%- for post in collections.posts | reverse %}
{%- set absolutePostUrl %}{{ post.url | url | absoluteUrl(metadata.url) }}{% endset -%}
2019-10-30 14:26:42 -04:00
{
"id": "{{ absolutePostUrl }}",
"url": "{{ absolutePostUrl }}",
"title": "{{ post.data.title }}",
"content_html": {% if post.templateContent %}{{ post.templateContent | htmlToAbsoluteUrls(absolutePostUrl) | dump | safe }}{% else %}""{% endif %},
"date_published": "{{ post.date | rssDate }}"
2019-10-30 14:26:42 -04:00
}
{%- if not loop.last -%}
,
{%- endif -%}
{%- endfor %}
]
}