diff options
author | Nicolas Goaziou <n.goaziou@gmail.com> | 2013-04-07 14:59:27 +0200 |
---|---|---|
committer | Nicolas Goaziou <n.goaziou@gmail.com> | 2013-04-07 14:59:27 +0200 |
commit | bd61cb2bf0ec41bb5919fdc8c02b44682363e222 (patch) | |
tree | c6b3b8e81e72b39b57f3eccba26f30623e955e4f | |
parent | c1d716f703acd0dcf6fd6c9568fd788e3af4f985 (diff) | |
download | org-mode-bd61cb2bf0ec41bb5919fdc8c02b44682363e222.tar.gz |
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.
-rw-r--r-- | lisp/ox-html.el | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 1d69f80..844a8d6 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) |