diff options
Diffstat (limited to 'src/gen/atom.njk')
-rw-r--r-- | src/gen/atom.njk | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/gen/atom.njk b/src/gen/atom.njk new file mode 100644 index 0000000..a603195 --- /dev/null +++ b/src/gen/atom.njk @@ -0,0 +1,27 @@ +--- +permalink: "/feed.xml" +--- +<?xml version="1.0" encoding="utf-8"?> +<feed xmlns="http://www.w3.org/2005/Atom"> + <title>{{ metadata.title }}</title> + <subtitle>${data.metadata.description}</subtitle> + {% set absoluteUrl %}{{ metadata.feed.path | url | absoluteUrl(metadata.url) }}{% endset %} + <link href="{{ metadata.feed.path | absoluteUrl(metadata.url) }}" rel="self"/> + <link href="{{ metadata.url }}"/> + <updated>{{ collections.posts | getNewestCollectionItemDate | dateToRfc3339 }}</updated> + <id>{{ metadata.feed.id }}</id> + <author> + <name>{{ metadata.author.name }}</name> + <email>{{ metadata.author.email }}</email> + </author> + {% for post in collections.posts | reverse %} + {% set absolutePostUrl %}{{ post.url | absoluteUrl(metadata.url) }}{% endset %} + <entry> + <title>{{ post.data.title }}</title> + <link href="{{ absolutePostUrl }}"/> + <updated>{{ post.date | dateToRfc3339 }}</updated> + <id>{{ absolutePostUrl }}</id> + <content type="html">{{ post.templateContent | htmlToAbsoluteUrls(absolutePostUrl) }}</content> + </entry> + {% endfor %} +</feed> |