summaryrefslogtreecommitdiffstats
path: root/publish.el
blob: 4467668100317fe41ff2936e982f3759f7ee2aed (plain)
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
(require 'package)
(package-initialize)

(require 'org)
(require 'org-id)
(require 'ox-publish)
(require 'ox-html)
(require 'oc)
(require 'oc-basic)
(require 'cl-lib)
(require 'gnuplot)
(require 'gnuplot-mode)
(require 'ob)
(require 'ob-gnuplot)

(org-babel-do-load-languages
 'org-babel-load-languages '((gnuplot . t)))

(setq org-confirm-babel-evaluate nil)

(setq org-html-coding-system 'utf-8-unix)

(defconst ymhg-notes-dir (file-name-directory (or load-file-name buffer-file-name)))

(defconst site-attachments
      (regexp-opt '("jpg" "jpeg" "gif" "png" "svg"
                    "ico" "cur" "css" "js" "woff" "html" "pdf" "js")))

(setq org-publish-project-alist
      (list
       (list "ymhg-notes-org"
             :base-directory (concat ymhg-notes-dir "notes")
             :base-extension "org"
             :publishing-function #'org-html-publish-to-html
             :publishing-directory (concat ymhg-notes-dir "public")
             :exclude (regexp-opt '("README" "draft"))
             :auto-sitemap t
             :sitemap-filename (concat ymhg-notes-dir "notes/index.org")
             :sitemap-file-entry-format "%d *%t*"
             :sitemap-title "Yann's Notes"
             :html-html5-fancy t
             :html-divs '((preamble "header" "header")
                      (content "article" "content")
                      (postamble "footer" "postamble"))
             :html-container "section"
             :html-metadata-timestamp-format "%Y-%m-%d"
             :html-checkbox-type 'html
             :html-doctype "html5"
             :html-head-include-default-style nil
             :html-table-caption-above t
             :html-postamble "<ul>
<li>© 2022 <a href=\"https://yannherklotz.com\">Yann Herklotz</a></li>
<li><a href=\"https://creativecommons.org/licenses/by-sa/4.0/\">CC BY-SA 4.0</a></li></ul>"
             :html-head "<link rel=\"stylesheet\" href=\"/css/main.css\">")
       (list "ymhg-notes-static"
             :base-directory (concat ymhg-notes-dir "notes/static")
             :include '()
             :exclude "assets/\\|public/\\|README.md"
             :base-extension site-attachments
             :publishing-directory (concat ymhg-notes-dir "public/static")
             :publishing-function #'org-publish-attachment
             :recursive t)
       (list "ymhg-notes-css"
             :base-directory (concat ymhg-notes-dir "css")
             :base-extension "css"
             :publishing-directory (concat ymhg-notes-dir "public/css")
             :publishing-function #'org-publish-attachment)
       (list "ymhg-notes" :components '("ymhg-notes-org" "ymhg-notes-static" "ymhg-notes-css"))))