Merge remote-tracking branch 'srht/master'
[worg.git] / publish.sh
blob4fa88e19cca1873333be5138bb9f9ccd35228bb5
1 #!/usr/bin/env sh
3 ":"; exec emacs --quick --script "$0" -- "$@" # -*- mode: emacs-lisp; lexical-binding: t; -*-
5 (add-to-list 'load-path "~/org-mode/lisp/")
6 (require 'ox-html)
7 (load "/usr/share/emacs/site-lisp/elpa-src/htmlize-1.55/htmlize.el")
9 (setq make-backup-files nil
10 debug-on-error t)
12 (setq org-confirm-babel-evaluate nil
13 org-html-style-default ""
14 org-html-scripts ""
15 org-html-htmlize-output-type 'css
16 org-html-doctype "html5"
17 org-html-html5-fancy t
18 org-html-validation-link nil
19 org-html-postamble nil)
21 (dolist (org-file (directory-files-recursively default-directory "\\.org$"))
22 (let ((html-file (concat (file-name-directory org-file)
23 (file-name-base org-file) ".html")))
24 (if (and (file-exists-p html-file)
25 (file-newer-than-file-p html-file org-file))
26 (message " [skipping] unchanged %s" org-file)
27 (message "[exporting] %s" (file-relative-name org-file default-directory))
28 (with-current-buffer (find-file org-file)
29 (condition-case err
30 (org-html-export-to-html)
31 (error (message (error-message-string err))))))))