shii.moe

Source for `shii.moe' website.
git clone git://git.knutsen.co/shii.moe
Log | Files | Refs | README | LICENSE

commit acda279c91ec5aea2f68a6cc8a6e3bcd736e1ba0
parent 8e9242475efbbccbcc64993a3d5cd18f3f05447f
Author: Demonstrandum <samuel@knutsen.co>
Date:   Mon, 15 Aug 2022 22:50:03 +0100

Serve correct mimetype for Atom feed.

Diffstat:
Mshiimoe/__init__.py | 7++++++-
Mshiimoe/templates/rss.xml | 10+++++-----
2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/shiimoe/__init__.py b/shiimoe/__init__.py @@ -207,9 +207,14 @@ def guestbook(): @app.route('/blog/index.xml') def rssblogposts(): posts = get_blog_posts() - return template('rss.xml', posts=posts) + feed = template('rss.xml', posts=posts) + res = app.make_response(feed) + res.mimetype = 'application/atom+xml' + return res @app.route('/blog') +@app.route('/blog/') +@app.route('/blog/index') @app.route('/blog/index.html') def blogindex(): posts = get_blog_posts() diff --git a/shiimoe/templates/rss.xml b/shiimoe/templates/rss.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <feed xmlns="http://www.w3.org/2005/Atom"> - <title>Shiimoe Blog Feed</title> + <title type="html">Shiimoe Blog Feed</title> <subtitle>Blog posts on shii.moe.</subtitle> {% block author %} <author> @@ -13,19 +13,19 @@ <category term="blog"/> <link href="https://shii.moe/rss.xml" rel="self" /> <link href="http://shii.moe/" /> - <id>shii.moe</id> + <id>https://shii.moe</id> <updated>{{ posts[0]['datetime'] }}Z</updated> {% for post in posts %} <entry> - <id>shii.moe/blog/{{ post['slug'] }}</id> - <title>{{ post['title'] }}</title> + <id>https://shii.moe/blog/{{ post['slug'] }}</id> + <title type="html">{{ post['title'] }}</title> <published>{{ post['pubdatetime'] }}Z</published> <updated>{{ post['datetime'] }}Z</updated> {{ self.author() }} <link rel="alternate" href="/blog/{{ post['slug'] }}"/> <category term="blog"/> - <content> + <content type="html"> <![CDATA[{{ post['content'] | safe }}]]> </content> </entry>