-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-site.el
54 lines (42 loc) · 1.61 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
;; -*- lexical-binding: t; -*-
(require 'ox-publish)
(message "Building")
;; Bootstrap HTMLize
(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 dependencies
(package-install 'htmlize)
;; Define the publishing project
(setq org-publish-project-alist
(list
(list "my-org-site"
:recursive t
:base-directory "./docs"
:publishing-directory "./public"
:publishing-function 'org-html-publish-to-html
:email "[email protected]"
:html5-fancy t
:with-email t
:auto-sitemap t)))
(setq org-html-validation-link nil)
(defconst stylesheet "style1.css")
(defconst main_js "main.js")
;; Custom appearance
(setq org-html-validation-link nil ;; Don't show validation link
org-html-head-include-scripts t ;; Use our own scripts
org-html-head-include-default-style nil ;; Use our own styles
org-html-head (format "<link rel=\"stylesheet\" href=\"%s\" /> <script src=\"%s\" /></script>" stylesheet main_js))
;; Generate the site output
(org-publish-all t)
;; Copy local css and JS
(message (format "Copying CSS ./docs/%s" stylesheet))
(copy-file (format "./docs/%s"stylesheet) "./public/" t nil nil nil)
(message (format "Copying JS ./docs/%s" main_js))
(copy-file (format "./docs/%s"main_js) "./public/" t nil nil nil)
(message "Build complete")