Config: Add commit hash to html export

also use last git change date, not current time
This commit is contained in:
TEC 2020-12-09 20:58:27 +08:00
parent e5cb16b14b
commit b5f928bec1
2 changed files with 5 additions and 1 deletions

View File

@ -1,7 +1,9 @@
# -*- mode: org; eval: (add-hook 'after-save-hook (lambda () (org-html-export-to-html t)) nil t) -*-
#+title: Doom Emacs Configuration
#+subtitle: The Methods, Management, and Menagerie of Madness
#+author: tecosaur
#+date: {{{modification-time(%Y-%m-%d %H:%M, t)}}} ;{{{timezone}}}, {{{git-rev}}}
#+macro: timezone (eval (substring (shell-command-to-string "date +%Z") 0 -1))
#+macro: git-rev (eval (format "@@html:<a href=\"https://github.com/tecosaur/emacs-config/commit/%1$s\" style=\"text-decoration: none\"><code style=\"padding: 0; color: var(--text-light); font-size: inherit; opacity: 0.7\">%1$s</code></a>@@@@latex:\\href{https://github.com/tecosaur/emacs-config/commit/%1$s}{%1$s}@@" (substring (shell-command-to-string "git rev-parse --short HEAD") 0 -1)))
#+startup: fold
#+property: header-args:emacs-lisp :tangle yes :cache yes :results silent :comments link
#+property: header-args:shell :tangle "setup.sh"

View File

@ -33,6 +33,8 @@
(- (float-time) start-time)
(expand-file-name "../config.org"))
(require 'vc) ; need this for modification-time macro
(with-current-buffer (find-file (expand-file-name "../config.org"))
(message "\033[0;33m[%.1fs] Exporting %s\033[0m"
(- (float-time) start-time)