diff --git a/make.el b/make.el index 093fed7..7eb953c 100644 --- a/make.el +++ b/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/")