From 96d437baab4a622eb540719feb90ea810fb01756 Mon Sep 17 00:00:00 2001 From: Dmitry Ilvokhin Date: Sat, 19 Apr 2025 21:43:53 +0100 Subject: Add support for atom / rss feed Date format was changed to support `updated` in ISO format. Now every post will require date and time, which might be a usability regression, but we'll see. Also, `updated` field was introduced in metadata. If there is no such field, them date field will be used instead. --- templates/atom.xml | 24 ++++++++++++++++++++++++ templates/feed.html | 7 +++++-- templates/post.html | 11 ++++++++--- 3 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 templates/atom.xml (limited to 'templates') diff --git a/templates/atom.xml b/templates/atom.xml new file mode 100644 index 0000000..ba7fbda --- /dev/null +++ b/templates/atom.xml @@ -0,0 +1,24 @@ + + blog.ilvokhin.com + tag:blog.ilvokhin.com,2022:blog.ilvokhin.com + + + {{ updated.isoformat() }} + + Dmitry Ilvokhin + https://ilvokhin.com/ + d@ilvokhin.com + +{% if posts %} + {% for post in posts %} + + {{ post.metadata.title }} + tag:blog.ilvokhin.com,2022:blog.ilvokhin.com/{{ post.name }} + + {{ post.metadata.date.isoformat() }} + {{ post.metadata.updated.isoformat() }} + {{ post.content }} + + {% endfor %} +{% endif %} + diff --git a/templates/feed.html b/templates/feed.html index deb89c5..e17d3d0 100644 --- a/templates/feed.html +++ b/templates/feed.html @@ -28,8 +28,8 @@
  • - @@ -41,6 +41,9 @@ + diff --git a/templates/post.html b/templates/post.html index 20c3ac2..f61a2bd 100644 --- a/templates/post.html +++ b/templates/post.html @@ -22,9 +22,14 @@

    {{ title }}

    - + + + {% if date != updated %} + (updated ) + {% endif %} + {% if status == "draft" %} • {{ status }} {% endif %} -- cgit v1.2.3-70-g09d2