From af38ad9e24c630e88bae79e0ac441d017916de0d Mon Sep 17 00:00:00 2001 From: azureazure Date: Sat, 13 Dec 2025 19:16:36 +0100 Subject: rewrite from the ground up --- build-site.el | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'build-site.el') diff --git a/build-site.el b/build-site.el index a77c7d9..cbbb41d 100644 --- a/build-site.el +++ b/build-site.el @@ -2,18 +2,27 @@ (setq org-html-validation-link nil org-html-head-include-scripts nil - org-html-head-include-default-style nil + ;; org-html-head-include-default-style nil org-html-head (with-temp-buffer (insert-file-contents "head.html") (buffer-string))) +(defun custom/sitemap-format-entry (entry style project) + (let ((filename (org-publish-find-title entry project)) + (date (org-publish-find-date entry project))) + (format "%s - [[file:%s][%s]]" + (format-time-string "[%Y-%m-%d %^a]" date) + entry + filename))) + (setq org-publish-project-alist (list - (list "content" - :recursive t + (list "pages" + :recursive nil :base-directory "./src" :publishing-function 'org-html-publish-to-html :publishing-directory "./public" + :with-title nil :with-author nil :with-creator nil :with-toc nil @@ -24,7 +33,18 @@ :base-directory "./src" :base-extension "css\\|png\\|ico\\|jpg\\|gif" :publishing-function 'org-publish-attachment - :publishing-directory "./public"))) + :publishing-directory "./public") + (list "blog" + :recursive t + :base-directory "./src/blog" + :publishing-directory "./public/blog" + :publishing-function 'org-html-publish-to-html + :section-numbers nil + :auto-sitemap t + :sitemap-title "blog posts" + :sitemap-filename "index.org" + :sitemap-sort-files 'anti-chronologically + :sitemap-format-entry 'custom/sitemap-format-entry))) (org-publish-all t) -- cgit v1.2.3