-
Notifications
You must be signed in to change notification settings - Fork 0
/
org_publish_posts.el
50 lines (41 loc) · 1.82 KB
/
org_publish_posts.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
;; Set the package installation directory so that packages aren't stored in the
;; ~/.emacs.d/elpa path.
(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))
(require 'ox-publish)
;; Install dependencies
(package-install 'htmlize)
(require 'htmlize)
(setq org-html-htmlize-output-type 'css)
(setq org-html-validation-link nil ;; Don't show validation link
org-html-head-include-scripts nil ;; Use our own scripts
org-html-head-include-default-style nil ;; Use our own styles
org-export-with-section-numbers nil ;; remove section numbering
org-html-head "<link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"/assets/favicon/apple-touch-icon.png\">
<link rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/assets/favicon/favicon-32x32.png\">
<link rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/assets/favicon/favicon-16x16.png\">
<link rel=\"manifest\" href=\"/assets/manifest.json\">
<link rel=\"stylesheet\" href=\"/css/base.css\" />
<link rel=\"stylesheet\" href=\"/css/prism-monokai.css\" />
")
;; Define the publishing project
(setq org-publish-project-alist
(list
(list "studies"
:makeindex t
:recursive t
:base-directory "./posts" ;; on CI
:publishing-directory "./site/posts"
:html-html5-fancy t
:with-toc t
:time-stamp-file nil
:with-author t
:publishing-function 'org-html-publish-to-html)))
(org-publish-all t)
(message "build finished!")