diff options
Diffstat (limited to 'feed.njk')
-rw-r--r-- | feed.njk | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/feed.njk b/feed.njk new file mode 100644 index 0000000..dcadf9c --- /dev/null +++ b/feed.njk @@ -0,0 +1,42 @@ +---json +{ + "permalink": "feed.xml", + "eleventyExcludeFromCollections": true, + "metadata": { + "title": "Mu", + "subtitle": "Thoughts, meditations and more.", + "language": "en", + "url": "https://u1d6b3.site", + "author": { + "name": "Marc Coquand", + "email": "marcc0000@pm.me" + } + } +} +--- +<?xml version="1.0" encoding="utf-8"?> +<feed xmlns="http://www.w3.org/2005/Atom" xml:base="{{ metadata.url }}"> + <title>{{ metadata.title }}</title> + <subtitle>{{ metadata.subtitle }}</subtitle> + <link href="{{ permalink | absoluteUrl(metadata.url) }}" rel="self"/> + <link href="{{ metadata.url }}"/> + <updated>{{ collections.posts | getNewestCollectionItemDate | dateToRfc3339 }}</updated> + <id>{{ metadata.url }}</id> + <author> + <name>{{ metadata.author.name }}</name> + <email>{{ metadata.author.email }}</email> + </author> + + {%- for post in collections.post | reverse %} + {%- set absolutePostUrl = post.url | absoluteUrl(metadata.url) %} + <entry> + <title>{{ post.data.title }}</title> + <link href="{{ absolutePostUrl }}"/> + <updated>{{ post.date | dateToRfc3339 }}</updated> + <id>{{ absolutePostUrl }}</id> + <content xml:lang="{{ metadata.language }}" type="html"> + {{ post.templateContent | htmlToAbsoluteUrls(absolutePostUrl) }} + </content> + </entry> + {%- endfor %} +</feed> |