xmitter-11ty/feed/json.njk
2020-07-27 11:40:11 -05:00

40 lines
1.1 KiB
Plaintext

---
# Metadata comes from _data/metadata.json
permalink: "{{ metadata.jsonfeed.path | url }}"
eleventyExcludeFromCollections: true
---
{
"version": "https://jsonfeed.org/version/1",
"title": "{{ metadata.title }}",
"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 -%}
{
"id": "{{ absolutePostUrl }}",
"url": "{{ absolutePostUrl }}",
"title": "{{ post.data.title }}",
"content_html": {{ post.templateContent | jsonStringify | safe }},
"date_published": "{{ post.date | rssDate }}",
"tags": [
{%- for c in post.data.category %}
"{{ c }}"
{%- if not loop.last -%}
,
{%- endif -%}
{%- endfor %}
]
}
{%- if not loop.last -%}
,
{%- endif -%}
{%- endfor %}
]
}