summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-11-14 02:57:10 +0100
committerThomas Voss <mail@thomasvoss.com> 2023-11-14 02:57:10 +0100
commitebb2e8d6e7a981bf35c5df6d5b4ce5d9ec0429cb (patch)
tree4a0f814fd0bf32f0c60cce7365b40e9069182521 /include
parent806ad9da7a8da5abbe353169ddadc5357779130c (diff)
Add dates to blog posts
Diffstat (limited to 'include')
-rw-r--r--include/lib.m411
1 files changed, 11 insertions, 0 deletions
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)}
+}⁩)