-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-site.el
129 lines (120 loc) · 4.55 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
(require 'package)
(setq package-user-dir (expand-file-name ".packages"))
(setq package-archives '(("melpa" . "https://melpa.org/packages/")
("elpa" . "https://elpa.gnu.org/packages/")))
(package-initialize)
(unless package-archive-contents
(package-refresh-contents))
(package-install 'htmlize)
(add-to-list 'load-path "./lisp")
(require 'ox-publish)
(require 'ox-html)
(require 'ox-rss)
(setq user-full-name "kb")
(setq user-mail-address "[email protected]")
(setq org-export-babel-evaluate nil)
(defun read-template (filename)
"Read template contents from FILENAME."
(with-temp-buffer
(insert-file-contents filename)
(buffer-string)))
(setq head-extra-template (read-template "templates/html_header.html"))
(setq header-template (read-template "templates/html_sub_header.html"))
(setq header-nav (read-template "templates/nav.html"))
(setq footer-template (read-template "templates/html_footer.html"))
(setq org-publish-project-alist
(list
(list "kennyballou.com"
:components '("blog"
"blog-rss"
"pages"
"talks"
"static"))
(list "blog"
:recursive t
:base-directory "./blog"
:publishing-directory "./public/blog/"
:htmlized-source t
:with-author t
:with-creator nil
:with-date t
:headline-level 4
:section-numbers nil
:with-toc t
:with-drawers nil
:with-sub-superscript t
:html-link-up "https://kennyballou.com/blog"
:html-link-home "https://kennyballou.com/"
:html-head-include-default-style t
:html-head-include-scripts t
:html-divs '((preamble "header" "")
(content "div" "main")
(postamble "footer" ""))
:html-head-extra head-extra-template
:html-preamble header-nav
:html-postamble footer-template
:publishing-function #'org-html-publish-to-html)
(list "blog-rss"
:recursive t
:base-directory "./blog"
:publishing-directory "./public/"
:exclude "*.org"
:include (list "index.org")
:publishing-function #'org-rss-publish-to-rss
:html-link-home "https://kennyballou.com"
:html-link-use-abs-url t
:table-of-contents nil)
(list "pages"
:recursive t
:base-directory "./pages"
:publishing-directory "./public/"
:htmlized-source t
:with-author t
:with-creator t
:with-date t
:headline-level 4
:section-numbers nil
:with-toc nil
:with-drawers nil
:with-sub-superscript t
:html-link-up "https://kennyballou.com/"
:html-link-home "https://kennyballou.com/"
:html-head-include-default-style t
:html-head-include-scripts t
:html-divs '((preamble "header" "")
(content "div" "main")
(postamble "footer" ""))
:html-head head-extra-template
:html-preamble header-nav
:html-postamble footer-template
:publishing-function #'org-html-publish-to-html)
(list "talks"
:recursive t
:base-directory "./talks"
:publishing-directory "./public/talks"
:htmlized-source t
:with-author t
:with-creator nil
:with-date t
:headline-level 4
:section-numbers nil
:with-toc nil
:with-drawers nil
:with-sub-superscript t
:html-link-up "https://kennyballou.com/talks"
:html-link-home "https://kennyballou.com/"
:html-divs '((preamble "header" "")
(content "div" "main")
(postamble "footer" ""))
:html-head-extra head-extra-template
:html-preamble header-nav
:html-postamble footer-template
:publishing-function #'org-html-publish-to-html)
(list "static"
:recursive t
:base-directory "./static"
:base-extension ".*"
:publishing-directory "./public/"
:publishing-function #'org-publish-attachment)))
(org-publish-all t)
(message "Build Complete!")