-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathbuild-site.el
47 lines (41 loc) · 1.75 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
(setq project-path (file-name-directory (or (buffer-file-name) load-file-name))
backup-directory-alist `(("." . ,(concat project-path ".backups")))
publish-project-path (concat project-path "dist/")
package-user-dir (concat project-path ".packages"))
(require 'org)
(require 'sh-script)
(require 'htmlize)
(require 'ox)
(require 'ox-html)
(require 'ox-publish)
(setq exclude-pattern "dist\\|.direnv\\|.packages\\|exercises\\|examples")
(setq org-html-validation-link nil
org-html-html5-fancy t
org-html-doctype "html5"
org-html-htmlize-output-type 'css
org-html-allow-name-attribute-in-anchors t
org-html-head-include-default-style nil
org-html-head-include-scripts nil
org-html-head (cl-loop for style in '("base.css" "htmlize.css" "style-overrides.css")
collect (format "<link rel=\"stylesheet\" href=\"assets/%s\" />\n"
style)
into styles
finally return (string-trim (apply #'concat styles)))
org-publish-timestamp-directory "./.org-timestamps/"
org-publish-project-alist
`(("static"
:base-directory ,project-path
:base-extension "css\\|png\\|jpe?g\\|svg"
:publishing-directory ,publish-project-path
:publishing-function org-publish-attachment
:exclude ,exclude-pattern
:recursive t)
("org"
:base-directory ,project-path
:publishing-directory ,publish-project-path
:publishing-function org-html-publish-to-html
:base-extension "org"
:exclude ,exclude-pattern
:time-stamp-file nil)
("site" :components ("static" "org"))))
(org-publish-all :force)