bun-activitypub/_content/atom.njk

37 lines
1.2 KiB
Text
Raw Normal View History

---json
{
"layout": null,
"permalink": "atom.xml",
"eleventyExcludeFromCollections": true,
"metadata": {
"subtitle": "A feed of all my posts on the fediverse",
"language": "en"
}
}
---
<?xml version="1.0" encoding="utf-8"?>
{% from "macro-summary.njk" import summaryMacro %}
<feed xmlns="http://www.w3.org/2005/Atom" xml:base="{{ ACTOR.url }}">
<title>{{ ACTOR.name }}'s feed</title>
<subtitle>{{ metadata.subtitle }}</subtitle>
<link href="{{ permalink | absoluteUrl(ACTOR.url) }}" rel="self"/>
<link href="{{ ACTOR.url }}"/>
<updated>{{ collections.feed[0].date | dateToRfc822 }}</updated>
<id>{{ ACTOR.url }}</id>
<author>
<name>{{ ACTOR.name }}</name>
</author>
{%- for post in collections.feed %}
{%- set absolutePostUrl = post.url | absoluteUrl(ACTOR.url) %}
<entry>
<title>{{ post.data.title }}</title>
<link href="{{ absolutePostUrl }}"/>
<updated>{{ post.date | dateToRfc822 }}</updated>
<id>{{ absolutePostUrl }}</id>
<content xml:lang="{{ metadata.language }}" type="html">
{{ summaryMacro(post.data, post.url) | htmlToAbsoluteUrls(absolutePostUrl) }}
{{ post.templateContent | htmlToAbsoluteUrls(absolutePostUrl) }}
</content>
</entry>
{%- endfor %}
</feed>