aboutsummaryrefslogtreecommitdiff
path: root/templates/blog_atom.rs.xml
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/blog_atom.rs.xml
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/blog_atom.rs.xml')
-rw-r--r--templates/blog_atom.rs.xml26
1 files changed, 26 insertions, 0 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>