-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-site.el
executable file
·79 lines (61 loc) · 1.97 KB
/
build-site.el
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
;;; package --- Build Org website
;;; Commentary:
;; Build website from Org-mode source files
;;; Code:
;; Set a package installation directory to avoid conflicts
(require 'package)
(setq package-user-dir (expand-file-name "./.packages"))
(setq package-archives '(("melpa" . "https://melpa.org/packages/")
("elpa" . "https://elpa.gnu.org/packages/")))
;; Initialize the package system
(package-initialize)
(unless package-archive-contents
(package-refresh-contents))
;; Install packages needed for HTML export
(package-install 'htmlize)
(package-install 'reformatter)
(package-install 'color-theme-modern)
(require 'htmlize)
(require 'ox-publish)
(require 'font-lock)
;; Using this library is a work-around to get color in HTML exports.
;; Otherwise Emacs in batch mode cannot get the correct faces
(load-theme 'greiner t t)
(enable-theme 'greiner)
;; Set some variables for the export
(global-font-lock-mode t)
(setq org-html-validation-link nil
org-html-head-include-scripts nil
org-html-include-default-style nil
org-confirm-babel-evaluate nil
org-src-fontify-natively t)
;; Define the project to be published
(setq org-publish-project-alist
(list
(list "assets"
:base-directory "./assets"
:base-extension 'any
:publishing-directory "./public/assets"
:publishing-function 'org-publish-attachment
:recursive t)
(list "supp"
:base-directory "./supp"
:base-extension 'any
:publishing-directory "./public/supp"
:publishing-function 'org-publish-attachment
:recursive t)
(list "blog"
:recursive t
:base-directory "./src"
:publishing-directory "./public"
:publishing-function 'org-html-publish-to-html
:with-author nil
:with-creator nil
:with-toc nil
:section-numbers nil
:time-stamp-file nil)))
;; Generate site
(org-publish-all t)
(message "Build completed")
(provide 'build-site)
;;; build-site.el ends here