aboutsummaryrefslogtreecommitdiff
path: root/build-site.el
blob: 2d7eedc28bd03cf70e379af32afe1bd6a9c7b8c0 (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
(require 'ox-publish)

(setq org-html-validation-link nil
      org-html-head-include-scripts nil
      org-html-doctype "html5"
      org-html-html5-fancy t
      org-html-head-include-default-style nil
      org-html-postamble nil
      org-html-head (with-temp-buffer
			    (insert-file-contents "head.html")
			    (buffer-string)))

(defun custom/sitemap-format-entry (entry style project)
  (let ((filename (org-publish-find-title entry project))
	(date (org-publish-find-date entry project)))
    (format "%s - [[file:%s][%s]]"
	    (format-time-string "%F" date)
	    entry
	    filename)))

(setq org-publish-project-alist
      (list
       (list "pages"
             :recursive nil
             :base-directory "./src"
             :publishing-function 'org-html-publish-to-html
             :publishing-directory "./public"
             ;; :with-title nil
             :with-toc nil
             :section-numbers nil
             :time-stamp-file nil)
       (list "assets"
	     :recursive t
	     :base-directory "./src"
	     :base-extension "css\\|png\\|ico\\|jpg\\|gif"
	     :publishing-function 'org-publish-attachment
	     :publishing-directory "./public")
      (list "blog"
	    :recursive t
	    :base-directory "./src/blog"
	    :publishing-directory "./public/blog"
	    :publishing-function 'org-html-publish-to-html
	    :section-numbers nil
	    :with-toc nil
	    :auto-sitemap t
	    :time-stamp-file nil
	    :sitemap-title "blog posts"
	    :sitemap-filename "index.org"
	    :sitemap-sort-files 'anti-chronologically
	    :sitemap-format-entry 'custom/sitemap-format-entry)))

(org-publish-all t)

(message "Build done!")