From: Christian Shtarkov Date: Sun, 20 Oct 2024 22:41:18 +0000 (+0100) Subject: Prettify article dates X-Git-Url: https://shtarkov.net/gitweb/?a=commitdiff_plain;h=b97726d57af23b5315aa323f2c8453de40e4813e;p=shtarkov.net.git Prettify article dates --- diff --git a/onerc.el b/onerc.el index 73b5e59..c1a7c48 100644 --- a/onerc.el +++ b/onerc.el @@ -46,6 +46,10 @@ (defun shtarkov.net-category (custom-id) (cadr (string-split custom-id "/"))) +(defun shtarkov.net-date (date) + (unless date (user-error "Expected a date.")) + (cadr (string-split date "[<> ]"))) + (defun shtarkov.net-home (page-tree pages _global) (let* ((website-name (one-default-website-name pages)) (content (org-export-data-with-backend @@ -110,7 +114,7 @@ (title (org-element-property :raw-value page-tree)) (category (shtarkov.net-category (org-element-property :CUSTOM_ID page-tree))) - (date (org-element-property :DATE page-tree)) + (date (shtarkov.net-date (org-element-property :DATE page-tree))) (content (org-export-data-with-backend (org-element-contents page-tree) 'shtarkov.net-ox nil)))