From 2b2d89ffd233e331a6985fe762ac339befc972a3 Mon Sep 17 00:00:00 2001
From: Dennis Fink
Date: Mon, 17 Aug 2026 19:36:16 +0200
Subject: Add post changelogs
This replaces the manual `updated_date` field with a changelog flow
field so post updates can be recorded as dated entries.
The blog template now derives the "Last updated" metadata from the
latest changelog entry and renders the full changelog in the article
footer, with dedicated styling for compact change notes.
---
templates/blocks/changelog.html | 1 +
templates/blog-post.html | 9 ++++----
templates/macros/blog.html | 51 ++++++++++++++++++++++++++++-------------
3 files changed, 41 insertions(+), 20 deletions(-)
create mode 100644 templates/blocks/changelog.html
(limited to 'templates')
diff --git a/templates/blocks/changelog.html b/templates/blocks/changelog.html
new file mode 100644
index 0000000..eee2bf1
--- /dev/null
+++ b/templates/blocks/changelog.html
@@ -0,0 +1 @@
+{# Changelog entries are rendered by the blog post template. #}
diff --git a/templates/blog-post.html b/templates/blog-post.html
index fe751ae..a8eaf37 100644
--- a/templates/blog-post.html
+++ b/templates/blog-post.html
@@ -13,6 +13,7 @@
{% endfor %}
{% set needs_trail_assets = features.trail %}
+{% set latest_change = this.changelog.blocks | max(attribute="date") if this.changelog else none %}
{% block meta %}
{{ super() }}
@@ -22,9 +23,9 @@
{% endif %}
- {% if this.updated_date %}
+ {% if latest_change %}
+ content="{{ latest_change.date }}T00:00:00+02:00">
{% endif %}
{% if this.category %}
{% set category = site.get("/categories/" + this.category) %}
@@ -46,8 +47,8 @@
{% set blog_url = '/blog' | url(absolute=True, external=True) %}
{% set blog_id = blog_url ~ '#blog' %}
{% set modified_date = this.publication_date %}
- {% if this.updated_date %}
- {% set modified_date = this.updated_date %}
+ {% if latest_change %}
+ {% set modified_date = latest_change.date %}
{% endif %}
{% set post_description = bag('blog.tagline') %}
{% if this.description %}
diff --git a/templates/macros/blog.html b/templates/macros/blog.html
index 13c2526..d076762 100644
--- a/templates/macros/blog.html
+++ b/templates/macros/blog.html
@@ -29,6 +29,8 @@
{% endfor %}
{% endif %}
+ {% set latest_change = post.changelog.blocks | max(attribute="date") if post.changelog else none %}
+
@@ -54,12 +56,12 @@
{% endif %}
- {% if post.updated_date and post.publication_date and (post.updated_date > post.publication_date) %}
+ {% if latest_change and post.publication_date and latest_change.date > post.publication_date %}
Last updated:
-
+
{% endif %}
@@ -82,20 +84,37 @@
{% endif %}
{{ post.body }}
- {% if post.tags %}
+ {% if post.tags or post.changelog %}
{% endif %}
--
cgit v1.3.1