aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorChristine Dodrill <me@christine.website>2020-07-26 23:12:01 -0400
committerGitHub <noreply@github.com>2020-07-26 23:12:01 -0400
commit6438d334cb195af23967f28f55e7bd207e1938db (patch)
treed293518b394aabcdc071fb83aeab81d31c642cef /templates
parentf9e20750dc743dfb79268fc5e7c6baa1c774030a (diff)
downloadxesite-6438d334cb195af23967f28f55e7bd207e1938db.tar.xz
xesite-6438d334cb195af23967f28f55e7bd207e1938db.zip
fix atom/RSS feeds (#186)
* fix atom feeds * also fix RSS feeds * add feeds fixed/flight journal post * fix tests
Diffstat (limited to 'templates')
-rw-r--r--templates/blog_atom.rs.xml26
-rw-r--r--templates/blog_rss.rs.xml20
-rw-r--r--templates/feeds.rs.html3
3 files changed, 48 insertions, 1 deletions
diff --git a/templates/blog_atom.rs.xml b/templates/blog_atom.rs.xml
new file mode 100644
index 0000000..c6fd32c
--- /dev/null
+++ b/templates/blog_atom.rs.xml
@@ -0,0 +1,26 @@
+@use crate::post::Post;
+@use chrono::Utc;
+
+@(posts: Vec<Post>)
+
+<?xml version='1.0' encoding='UTF-8'?>
+<feed xmlns="http://www.w3.org/2005/Atom">
+ <id>https://christine.website/blog.atom</id>
+ <title>Christine Dodrill's Blog</title>
+ <updated>@Utc::now().to_rfc3339()</updated>
+ <author>
+ <name>Christine Dodrill</name>
+ <email>me@@christine.website</email>
+ </author>
+ <link href="https://christine.website/blog.atom" rel="self"/>
+ <link href="https://christine.website/blog" rel="alternate"/>
+ <generator uri="@env!("CARGO_PKG_REPOSITORY")" version="@env!("CARGO_PKG_VERSION")">@env!("CARGO_PKG_NAME")</generator>
+ @for post in posts {
+ <entry>
+ <id>https://christine.website/@post.link</id>
+ <title>@post.front_matter.title</title>
+ <updated>@post.date.to_rfc3339()</updated>
+ <link href="https://christine.website/@post.link" rel="alternate"/>
+ </entry>
+ }
+</feed>
diff --git a/templates/blog_rss.rs.xml b/templates/blog_rss.rs.xml
new file mode 100644
index 0000000..02b5ce0
--- /dev/null
+++ b/templates/blog_rss.rs.xml
@@ -0,0 +1,20 @@
+@use crate::post::Post;
+
+@(posts: Vec<Post>)
+<?xml version="1.0" encoding="UTF-8" ?>
+<rss version="2.0">
+ <channel>
+ <title>Christine Dodrill's Blog</title>
+ <link>https://christine.website/blog</link>
+ <description>Tech, philosophy and more</description>
+ @for post in posts {
+ <item>
+ <title>@post.front_matter.title</title>
+ <link>https://christine.website/@post.link</link>
+ <description></description>
+ <pubDate>@post.date.to_rfc2822()</pubDate>
+ </item>
+
+ }
+ </channel>
+</rss>
diff --git a/templates/feeds.rs.html b/templates/feeds.rs.html
index bb825a0..797755c 100644
--- a/templates/feeds.rs.html
+++ b/templates/feeds.rs.html
@@ -7,9 +7,10 @@
<h1>Feeds</h1>
<ul>
- <li>Blog: <a href="/blog.rss">RSS</a> - <a href="/blog.json">JSONFeed</a></li>
+ <li>Blog: <a href="/blog.atom">Atom</a> <a href="/blog.rss">RSS</a> - <a href="/blog.json">JSONFeed</a></li>
<li>Twitter: <a href="https://rssbox.herokuapp.com/twitter/2573767249/theprincessxena">RSS</a></li>
<li>Mastodon: <a href="https://mst3k.interlinked.me/users/cadey.rss">RSS</a></li>
+ <li>Flight Journal: Atom <a href="gemini://cetacean.club/journal/atom.xml">Gemini</a> <a href="https://portal.mozz.us/gemini/cetacean.club/journal/atom.xml">HTTPS</a></li>
</ul>
@:footer_html()