summaryrefslogtreecommitdiff
path: root/build.el
blob: b8be55fd212259c4842225044782d2dc386a5ebf (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
#! /home/arun/.guix-profile/bin/emacs --script

(require 'ox-publish)

(setq org-publish-project-alist
      '(("pages"
	 :base-directory "pages"
	 :base-extension "org"
	 :publishing-directory "site"
	 :publishing-function org-html-publish-to-html
	 :html-head "<link rel=\"stylesheet\" type=\"text/css\" href=\"static/style.css\"/>"
	 :html-postamble nil
	 :html-indent t)
	("static"
	 :base-directory "static"
	 :base-extension any
	 :publishing-directory "site/static"
	 :publishing-function org-publish-attachment))
      org-export-with-section-numbers nil
      org-export-with-toc nil
      org-html-head-include-default-style nil
      org-html-head-include-scripts nil
      org-export-filter-link-functions
      (list (lambda (output backend info)
	      (string-match "<a href=\"\\([^\"]*\\)\">" output)
	      (let ((href (match-string 1 output)))
		(if (string-prefix-p "http" href)
		    output
		  (replace-match (file-name-base href)
				 nil nil output 1)))))
      make-backup-files nil)

(org-publish-all)