Builds feed URL from site URL to reduce replication

This commit is contained in:
Ben Edwards 2019-07-23 18:00:11 +01:00
parent 105436b2bb
commit a9f9d1bc96
2 changed files with 2 additions and 2 deletions

1
_data/metadata.json Normal file → Executable file
View File

@ -6,7 +6,6 @@
"subtitle": "I am writing about my experiences as a naval navel-gazer.", "subtitle": "I am writing about my experiences as a naval navel-gazer.",
"filename": "feed.xml", "filename": "feed.xml",
"path": "/feed/feed.xml", "path": "/feed/feed.xml",
"url": "https://myurl.com/feed/feed.xml",
"id": "https://myurl.com/" "id": "https://myurl.com/"
}, },
"author": { "author": {

3
feed/feed.njk Normal file → Executable file
View File

@ -6,7 +6,8 @@ eleventyExcludeFromCollections: true
<feed xmlns="http://www.w3.org/2005/Atom"> <feed xmlns="http://www.w3.org/2005/Atom">
<title>{{ metadata.title }}</title> <title>{{ metadata.title }}</title>
<subtitle>{{ metadata.feed.subtitle }}</subtitle> <subtitle>{{ metadata.feed.subtitle }}</subtitle>
<link href="{{ metadata.feed.url }}" rel="self"/> {% set absoluteUrl %}{{ metadata.feed.path | url | absoluteUrl(metadata.url) }}{% endset %}
<link href="{{ absoluteUrl }}" rel="self"/>
<link href="{{ metadata.url }}"/> <link href="{{ metadata.url }}"/>
<updated>{{ collections.posts | rssLastUpdatedDate }}</updated> <updated>{{ collections.posts | rssLastUpdatedDate }}</updated>
<id>{{ metadata.feed.id }}</id> <id>{{ metadata.feed.id }}</id>