Simplify the Atom and JSON feeds
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
---
|
||||
# Metadata comes from _data/metadata.json
|
||||
permalink: "{{ metadata.jsonfeed.path }}"
|
||||
permalink: /feed/feed.json
|
||||
---
|
||||
{
|
||||
"version": "https://jsonfeed.org/version/1.1",
|
||||
"title": "{{ metadata.title }}",
|
||||
"language": "{{ metadata.language }}",
|
||||
"home_page_url": "{{ metadata.url }}",
|
||||
"feed_url": "{{ metadata.jsonfeed.url }}",
|
||||
"feed_url": "{{ permalink | url | absoluteUrl(metadata.url) }}",
|
||||
"description": "{{ metadata.description }}",
|
||||
"author": {
|
||||
"name": "{{ metadata.author.name }}",
|
||||
@@ -15,17 +15,15 @@ permalink: "{{ metadata.jsonfeed.path }}"
|
||||
},
|
||||
"items": [
|
||||
{%- for post in collections.posts | reverse %}
|
||||
{%- set absolutePostUrl %}{{ post.url | url | absoluteUrl(metadata.url) }}{% endset -%}
|
||||
{%- set absolutePostUrl = post.url | url | absoluteUrl(metadata.url) %}
|
||||
{
|
||||
"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 }}"
|
||||
"date_published": "{{ post.date | dateToRfc3339 }}"
|
||||
}
|
||||
{%- if not loop.last -%}
|
||||
,
|
||||
{%- endif -%}
|
||||
{% if not loop.last %},{% endif %}
|
||||
{%- endfor %}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user