aboutsummaryrefslogtreecommitdiff
path: root/makedocs.el
blob: 66750925a6dfc1a2dc68274ba76b170bd478453a (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
(require 'ox-publish)

;; 1. Define the project paths relative to this script
(setq project-root (file-name-directory (or load-file-name buffer-file-name)))
(setq org-notes-dir (expand-file-name "docs/" project-root))
(setq public-dir (expand-file-name "public/" project-root))

;; 2. Set up the publishing configuration
(setq org-publish-project-alist
      `(("project-docs"
         :base-directory ,org-notes-dir
         :base-extension "org"
         :publishing-directory ,public-dir
         :recursive t
         :publishing-function org-html-publish-to-html
         :headline-levels 4
         :auto-preamble t
         ;; This ensures ReadTheOrg works correctly
         :html-head "<link rel=\"stylesheet\" type=\"text/css\" href=\"https://fniessen.github.io/org-html-themes/src/readtheorg_theme/css/readtheorg.css\"/>
            <script src=\"https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js\"></script>
            <script src=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js\"></script>
            <script type=\"text/javascript\" src=\"https://fniessen.github.io/org-html-themes/src/readtheorg_theme/js/readtheorg.js\"></script>"
         :html-head-extra "<link rel='stylesheet' type='text/css' href='https://gongzhitaao.org/orgcss/org.css'/>")
        ("project-static"
         :base-directory ,org-notes-dir
         :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf"
         :publishing-directory ,public-dir
         :recursive t
         :publishing-function org-publish-attachment)
        ("all" :components ("project-docs" "project-static"))))

;; 3. The magic command to build everything
(org-publish-all t)

(message "Build complete!")