-
Notifications
You must be signed in to change notification settings - Fork 1
/
build-site.el
executable file
·69 lines (50 loc) · 1.69 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
;;; 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 'nix-mode)
(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-safe-remote-resources '("https://fniessen.github.io/org-html-themes/org/theme-readtheorg.setup")
org-src-fontify-natively t)
;; Define the project to be published
(setq org-publish-project-alist
(list
(list "emacsd"
:recursive t
:base-directory "./content"
:publishing-directory "./public"
:publishing-function 'org-html-publish-to-html
:with-author t
:with-creator nil
:with-toc t
:setion-numbers nil
:time-stamp-file nil)))
;; Generate site
(org-publish-all t)
(message "Build completed")
(provide 'build-site)
;;; build-site.el ends here