From bd61cb2bf0ec41bb5919fdc8c02b44682363e222 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sun, 7 Apr 2013 14:59:27 +0200 Subject: [PATCH] ox-html: Allow to add last modification time in preamble/postamble * lisp/ox-html.el (org-html-postamble-format, org-html-preamble-format): Allow last modification time of source in template. (org-html-format-spec): Produce last modification time when the source is a file. --- lisp/ox-html.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 1d69f806a..844a8d681 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -1037,6 +1037,7 @@ postamble itself. This format string can contain these elements: %c will be replaced by `org-html-creator-string'. %v will be replaced by `org-html-validation-link'. %T will be replaced by the export time. + %C will be replaced by the last modification time. If you need to use a \"%\" character, you need to escape it like that: \"%%\"." @@ -1097,6 +1098,7 @@ preamble itself. This format string can contain these elements: %c will be replaced by `org-html-creator-string'. %v will be replaced by `org-html-validation-link'. %T will be replaced by the export time. + %C will be replaced by the last modification time. If you need to use a \"%\" character, you need to escape it like that: \"%%\". @@ -1506,6 +1508,10 @@ used in the preamble or postamble." (split-string (plist-get info :email) ",+ *") ", ")) (?c . ,(plist-get info :creator)) + (?C . ,(let ((file (plist-get info :input-file))) + (format-time-string org-html--timestamp-format + (if file (nth 5 (file-attributes file)) + (current-time))))) (?v . ,(or org-html-validation-link "")))) (defun org-html--build-pre/postamble (type info) -- 2.11.4.GIT