Make blog index include publish dates

Signed-off-by: magic_rb <richard@brezak.sk>
This commit is contained in:
magic_rb 2023-12-30 19:22:48 +01:00
parent d89980fff2
commit 55f46d2191
No known key found for this signature in database
GPG key ID: 08D5287CC5DDCA0E

19
make.el
View file

@ -62,8 +62,8 @@
(let ((org-inhibit-startup nil))
(insert (car x))
(org-mode)
(goto-char (point-min))
(org-element-link-parser)))
(goto-char (point-max))
(org-element-context)))
(`nil (error "Unreachable"))
(link (not (seq-contains-p
exclude
@ -72,6 +72,20 @@
list)))
(org-publish-sitemap-default title filtered-list))))
(defun org-publish-sitemap-entry-with-date (entry style project)
"Default format for site map ENTRY, as a string.
ENTRY is a file name. STYLE is the style of the sitemap.
PROJECT is the current project."
(cond ((not (directory-name-p entry))
(format "%s [[file:%s][%s]]"
(format-time-string "%Y-%m-%d" (org-publish-find-date entry project))
entry
(org-publish-find-title entry project)))
((eq style 'tree)
;; Return only last subdir.
(file-name-nondirectory (directory-file-name entry)))
(t entry)))
(defvar org-publish-project-alist)
(setq org-publish-project-alist
`(
@ -96,6 +110,7 @@
:sitemap-filename "sitemap.inc"
:sitemap-sort-files anti-chronologically
:sitemap-function ,(org-publish-sitemap-filtered '())
:sitemap-format-entry org-publish-sitemap-entry-with-date)
("redalder-blog-index"
:base-directory ,(expand-file-name "./blog/")
:root-directory ,(expand-file-name "./blog/")