bun-activitypub/_content/json.njk

36 lines
1.1 KiB
Text
Raw Normal View History

---json
{
"layout": null,
"permalink": "feed.json",
"eleventyExcludeFromCollections": true,
"metadata": {
"subtitle": "A feed of all my posts on the fediverse",
"language": "en"
}
}
---
{ {% from "macro-summary.njk" import summaryMacro %}
"version": "https://jsonfeed.org/version/1.1",
"title": "{{ ACTOR.name }}'s feed",
"language": "{{ metadata.language }}",
"home_page_url": "{{ ACTOR.url }}",
"feed_url": "{{ permalink | absoluteUrl(ACTOR.url) }}",
"description": "{{ metadata.subtitle }}",
"author": {
"name": "{{ ACTOR.name }}",
"url": "{{ ACTOR.url }}"
},
"items": [
{%- for post in collections.feed %}
{%- set absolutePostUrl = post.url | absoluteUrl(ACTOR.url) %}
{
"id": "{{ absolutePostUrl }}",
"url": "{{ absolutePostUrl }}",
"title": "{{ post.data.title }}",
"content_html": {{ summaryMacro(post.data, post.url) | concat(post.templateContent) | htmlToAbsoluteUrls(absolutePostUrl) | dump | safe }},
"date_published": "{{ post.date | dateToRfc3339 }}"
}
{% if not loop.last %},{% endif %}
{%- endfor %}
]
}