From ebb2e8d6e7a981bf35c5df6d5b4ce5d9ec0429cb Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Tue, 14 Nov 2023 02:57:10 +0100 Subject: Add dates to blog posts --- include/lib.m4 | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include') diff --git a/include/lib.m4 b/include/lib.m4 index 6220c84..24a911f 100644 --- a/include/lib.m4 +++ b/include/lib.m4 @@ -20,3 +20,14 @@ m4_define( m4_dnl Macro for generating abbrevations m4_define(m4_abbr, ⁨@abbr .m4_translit($1, A-Z2, a-zt) {-$1}⁩) + +m4_define(m4_file_create_date, ⁨m4_esyscmd( + git log --reverse --pretty='format:%cI' $(dirname m4___file__)/$1/index.gsp \ + | head -n1 \ + | xargs date +'%-d %B %Y' -d +)⁩) + +m4_define(m4_article, ⁨li .article { + a href="$1" $2 + span {-m4_file_create_date($1)} +}⁩) -- cgit v1.2.3