From 9ae2381d49aaff705fe5966de399f41fc7521798 Mon Sep 17 00:00:00 2001 From: yum Date: Tue, 28 Jul 2026 14:34:36 -0700 Subject: Add dates to home page --- article-dates.lua | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 article-dates.lua (limited to 'article-dates.lua') diff --git a/article-dates.lua b/article-dates.lua new file mode 100644 index 0000000..72bdba5 --- /dev/null +++ b/article-dates.lua @@ -0,0 +1,19 @@ +function Pandoc(doc) + local heading + + for _, block in ipairs(doc.blocks) do + if block.t == "Header" and block.level == 1 then + heading = block + elseif heading and block.t == "Para" then + local date = pandoc.utils.stringify(block.content) + table.insert(heading.content, pandoc.RawInline( + "html", '' .. date .. "" + )) + heading = nil + else + heading = nil + end + end + + return doc +end -- cgit v1.2.3