-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-site.el
66 lines (55 loc) · 1.98 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
;; load emacs package manager
(require 'package)
;; install packages in a local directory
(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))
(setq make-backup-files nil) ;; stop emacs from creating backup files
;; Install dependencies (for formatting code blocks)
(package-install 'htmlize)
;; Load the publishing system
(require 'ox-publish)
(setq org-html-head (org-file-contents "./content/html/head.html"))
(setq org-html-preamble (org-file-contents "./content/html/preamble.html"))
;; (setq org-html-postamble (org-file-contents "./content/html/postamble.html"))
;; Define the publishing project
(setq org-publish-project-alist
'(("patrickdelliott.com"
:recursive t
:base-directory "./content/"
:publishing-directory "./public/"
:publishing-function org-html-publish-to-html
:with-author t
:with-creator nil
:with-toc nil
:section-numbers nil
:time-stamp-file t
:html-container "section"
:html-divs ((preamble "nav" "preamble")
(content "main" "content") ;; necessary to get the right styling
(postamble "footer" "postamble"))
:html-doctype "html5"
:headline-levels 2
:html-html5-fancy t
:html-head-include-default-style nil
:html-head-include-scripts nil
:html-validation-link nil
:html-mathjax-template ""
;; :html-preamble nil
:html-postamble nil
:auto-sitemap t
:sitemap-filename "sitemap.org"
)
("images"
:base-directory "./content/"
:base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|eot\\|svg\\|ttf\\|woff"
:publishing-directory "./public/"
:recursive t
:publishing-function org-publish-attachment)))
;; Generate the site output
(org-publish-all t)
(message "Build complete!")