]> shtarkov.net Git - shtarkov.net.git/commitdiff
Prettify article dates
authorChristian Shtarkov <ops+git@shtarkov.net>
Sun, 20 Oct 2024 22:41:18 +0000 (23:41 +0100)
committerChristian Shtarkov <ops+git@shtarkov.net>
Sun, 20 Oct 2024 22:41:18 +0000 (23:41 +0100)
onerc.el

index 73b5e593b1126af7364be2cd74a72ab2054693f9..c1a7c480fca694662dfcf8c3e87ce09fbcbedde1 100644 (file)
--- a/onerc.el
+++ b/onerc.el
 (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
          (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)))