summaryrefslogtreecommitdiff
path: root/org-conf.el
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2022-08-30 04:02:25 +0800
committerJSDurand <mmemmew@gmail.com>2022-08-30 04:02:25 +0800
commitda08a90a4018b599993fdca3173f3e495ca2fc6b (patch)
tree1ff956c6a090f44a7439f1b1cd13cecf8d0a3f81 /org-conf.el
parente08204d423766c29f72e0e224f061ab30fc0340d (diff)
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.
Diffstat (limited to 'org-conf.el')
-rw-r--r--org-conf.el55
1 files 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\"/>")
"<link rel='shortcut icon' \
href='https://jsdurand.xyz/favicon.ico'/>")
+;;;; 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 "<a href=\"mailto:durand@jsdurand.xyz\">
+durand@jsdurand.xyz</a>")
+ (created (format-time-string "%F %a %T %Z"))
+ (creator
+ (format
+ "%s (<a href=\"https://orgmode.org\">Org</a> mode %s)"
+ (replace-regexp-in-string
+ "GNU Emacs"
+ "<a href=\"https://www.gnu.org/software/emacs/\">\
+GNU Emacs</a>"
+ (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 <em>copyleft</em> license \
+<a href=\"https://creativecommons.org/licenses/by-sa/4.0/legalcode\">
+CC BY-SA </a>."))
+ (format
+ "<p class=\"copyleft\">%s</p>
+<p class=\"author\">Author: %s</p>
+<p class=\"email\">Email: %s</p>
+<p class=\"date\">Created: %s</p>
+<p class=\"creator\">%s</p>
+<p class=\"validation\">%s</p>"
+ 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