diff options
author | Starfall <us@starfall.systems> | 2023-05-23 12:14:00 -0500 |
---|---|---|
committer | Starfall <us@starfall.systems> | 2023-05-24 12:51:23 -0500 |
commit | 5c0a183a1d830479e4cfc705bdc9f13b2b1efac2 (patch) | |
tree | 40dc719987731076bcdc80632aefa4e74b1817d5 /src/feed.njk | |
parent | 1df389da097411e437aa33aa104132bc593e1ed4 (diff) |
feature: atom feed
- add atom feed - add theme-colored feed icon to /blog/
Diffstat (limited to 'src/feed.njk')
-rw-r--r-- | src/feed.njk | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/feed.njk b/src/feed.njk new file mode 100644 index 0000000..d1a9c0a --- /dev/null +++ b/src/feed.njk @@ -0,0 +1,38 @@ +--- +permalink = "feed.xml" + +[metadata] +name = "devin & Alex Starfall" +email = "us@starfall.systems" +baseurl = "https://starfall.systems/" +blogurl = "https://starfall.systems/blog/" +--- +<?xml version="1.0" encoding="utf-8"?> +<feed xmlns="http://www.w3.org/2005/Atom"> + <title>Starfall's Blog</title> + <link href="{{ permalink | absoluteUrl(metadata.baseurl) }}" rel="self"/> + <link href="{{ metadata.blogurl }}"/> + <updated>{{ collections.post | getNewestCollectionItemDate | dateToRfc3339 }}</updated> + <id>{{ metadata.baseurl }}</id> + + <author> + <name>{{ metadata.name }}</name> + <email>{{ metadata.email }}</email> + </author> + +{% for post in collections.post | reverse %} +{%- set absolutePostUrl = post.url | absoluteUrl(metadata.baseurl) %} + <entry> + <title>{{ post.data.title }}</title> + <updated>{{ post.date | dateToRfc3339 }}</updated> + <link href="{{ absolutePostUrl }}"/> + <id>{{ absolutePostUrl }}</id> + {%- if post.data.page.excerpt %} + <summary>{{- post.data.page.excerpt -}}</summary> + {% endif -%} + <content type="html"> + {{- post.templateContent | htmlToAbsoluteUrls(absolutePostUrl) -}} + </content> + </entry> +{% endfor %} +</feed> |