mirror of
https://git.sr.ht/~magic_rb/website
synced 2024-11-22 00:04:20 +01:00
Make blog index include publish dates
Signed-off-by: magic_rb <richard@brezak.sk>
This commit is contained in:
parent
d89980fff2
commit
55f46d2191
19
make.el
19
make.el
|
@ -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/")
|
||||
|
|
Loading…
Reference in a new issue