Skip to content

Instantly share code, notes, and snippets.

@drannex42
Last active May 27, 2022 01:19
Show Gist options
  • Save drannex42/1d171423d2bd3e1e08ab22beafd1f08e to your computer and use it in GitHub Desktop.
Save drannex42/1d171423d2bd3e1e08ab22beafd1f08e to your computer and use it in GitHub Desktop.
---json
{
"permalink": "feed.xml",
"layout": "clear",
"eleventyExcludeFromCollections": true,
"metadata": {
"title": "Drannex42 | Web Portal Feed",
"subtitle": "The personal website of Macleod Sawyer, Director (CEO) of DNX Industries, known primarily online as Drannex42.",
"url": "https://drannex42.com/",
"feedUrl": "https://drannex42.com/feed.xml",
"author": {
"name": "Drannex42",
"email": "[email protected]"
}
}
}
---
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>{{ metadata.title }}</title>
<subtitle>{{ metadata.subtitle }}</subtitle>
<link href="{{ metadata.feedUrl }}" 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.all %}
{% set absolutePostUrl %}{{ post.url | 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment