From da08a90a4018b599993fdca3173f3e495ca2fc6b Mon Sep 17 00:00:00 2001 From: JSDurand Date: Tue, 30 Aug 2022 04:02:25 +0800 Subject: org: add a custom postamble * org-conf.el (durand-org-postamble, org-publish-project-alist): Use a custom function to generate the postamble. This enables me to insert a copyleft claim, and to customize the date / time format a little. --- org-conf.el | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 51 insertions(+), 4 deletions(-) diff --git a/org-conf.el b/org-conf.el index a66a4a0..3eed2ec 100644 --- a/org-conf.el +++ b/org-conf.el @@ -583,6 +583,49 @@ href=\"website.css\"/>") "") +;;;; Custom postamble + +(defun durand-org-postamble (_plist) + "Return the postamble string. +PLIST specifies the settings of the project. + +Since I am the only one who uses this function, I simply ignore +that argument." + (let ((author "JSDurand") + (email " +durand@jsdurand.xyz") + (created (format-time-string "%F %a %T %Z")) + (creator + (format + "%s (Org mode %s)" + (replace-regexp-in-string + "GNU Emacs" + "\ +GNU Emacs" + (replace-regexp-in-string + (rx-to-string '(seq " (" (* (not ?\n)) ?\n) t) "" + (emacs-version)) + t) + (org-version))) + (validate-link org-html-validation-link) + (copyleft "All original content is licensed under the \ +free copyleft license \ + +CC BY-SA .")) + (format + "

%s

+

Author: %s

+

Email: %s

+

Created: %s

+

%s

+

%s

" + copyleft + author + email + created + creator + validate-link))) + ;;;; Don't include JavaScript in the HTML (setq org-html-head-include-scripts nil) @@ -623,7 +666,8 @@ href='https://jsdurand.xyz/favicon.ico'/>") :html-link-home "" :html-link-up "" :html-home/up-format "" - :html-preamble #'durand-org-publish-insert-sidebar) + :html-preamble #'durand-org-publish-insert-sidebar + :html-postamble #'durand-org-postamble) (list "math" :base-directory (directory-file-name @@ -653,7 +697,8 @@ href='https://jsdurand.xyz/favicon.ico'/>") :html-link-home "" :html-link-up "" :html-home/up-format "" - :html-preamble #'durand-org-publish-insert-sidebar) + :html-preamble #'durand-org-publish-insert-sidebar + :html-postamble #'durand-org-postamble) (list "life" :base-directory (directory-file-name @@ -683,7 +728,8 @@ href='https://jsdurand.xyz/favicon.ico'/>") :html-link-home "" :html-link-up "" :html-home/up-format "" - :html-preamble #'durand-org-publish-insert-sidebar) + :html-preamble #'durand-org-publish-insert-sidebar + :html-postamble #'durand-org-postamble) (list "main" :base-directory (directory-file-name @@ -706,7 +752,8 @@ href='https://jsdurand.xyz/favicon.ico'/>") :html-link-home "" :html-link-up "" :html-home/up-format "" - :html-preamble #'durand-org-publish-insert-sidebar))) + :html-preamble #'durand-org-publish-insert-sidebar + :html-postamble #'durand-org-postamble))) ;;;; Sitemap function -- cgit v1.2.3-18-g5258