~bzg/orgweb

ref: 605279bea2c7f3e2f520b6030959982af1c86346 orgweb/publish.sh -rwxr-xr-x 1.4 KiB
605279beBastien publish.sh: Call `ox-extras-activate' a month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env sh

":"; exec emacs --quick --script "$0" -- "$@" # -*- mode: emacs-lisp; lexical-binding: t; -*-

(add-to-list 'load-path "~/org-mode/lisp/")
(add-to-list 'load-path "~/org-contrib/lisp/")
(require 'ox-html)
(require 'ox-extra)
(ox-extras-activate '(ignore-headlines))
(load "/usr/share/emacs/site-lisp/elpa-src/htmlize-1.55/htmlize.el")

(setq make-backup-files nil
      debug-on-error t)

(setq org-confirm-babel-evaluate nil
      org-html-style-default ""
      org-html-scripts ""
      org-html-htmlize-output-type 'css
      org-html-doctype "html5"
      org-html-html5-fancy t
      org-html-validation-link nil
      org-html-postamble t
      org-html-postamble-format
       `(("en" ,(with-temp-buffer
		  (insert-file-contents-literally "./resources/postamble.html")
		  (buffer-substring-no-properties (point-min) (point-max))))))

(dolist (org-file (directory-files-recursively default-directory "\\.org$"))
  (let ((html-file (concat (file-name-directory org-file)
			   (file-name-base org-file) ".html")))
    (if (and (file-exists-p html-file)
             (file-newer-than-file-p html-file org-file))
	(message " [skipping] unchanged %s" org-file)
      (message "[exporting] %s" (file-relative-name org-file default-directory))
      (with-current-buffer (find-file org-file)
	(condition-case err
            (org-html-export-to-html)
          (error (message (error-message-string err))))))))