summaryrefslogtreecommitdiff
path: root/site/publish.el
blob: e8248f0317ac018d156ab3032905fccbb6ab3519 (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
69
70
71
72
73
74
;;; publish.el --- Publish the Smart Documents website.

;; Copyright (C) 2021 Marius Peter

;; Author: Marius Peter

;;; Commentary:

;; This file is intended to be run as a script for the Makefile used
;; to generate the Smart Documents website.

;;; Code:

(require 'ox-publish)
(load-file "./ox-html-uswds.el")

;; (let ((publishing-location "~/Documents/www/"))
(let ((publishing-location "/ssh:root@192.162.71.223:/var/www/smart-documents.org/"))
  (setq org-publish-project-alist
	`(("page"
           :base-directory "."
           :base-extension "org"
           :publishing-directory ,publishing-location
	   :recursive nil ; Top-level pages are all in top-level org directory.
           :publishing-function ox-html-uswds-publish-to-html
           :auto-sitemap t)
          ("page-media"
           :base-directory "assets/images/"
           :base-extension "jpg\\|gif\\|png\\|svg\\|mp3"
           :publishing-directory ,(concat publishing-location "assets/images/")
	   :recursive t
           :publishing-function org-publish-attachment)
          ("posts"
           :base-directory "posts/"
           :base-extension "org"
           :publishing-directory ,(concat publishing-location "posts/")
	   :recursive t
           :publishing-function ox-html-uswds-publish-to-html)
          ("css"
           :base-directory "assets/"
           :base-extension "css\\|map"
           :publishing-directory ,(concat publishing-location "assets/")
           :publishing-function org-publish-attachment
           :recursive t)
          ("js"
           :base-directory "assets/"
           :base-extension "js"
           :publishing-directory ,(concat publishing-location "assets/")
           :publishing-function org-publish-attachment
           :recursive t)
	  ("fonts"
           :base-directory "assets/"
           :base-extension "ttf\\|woff2"
           :publishing-directory ,(concat publishing-location "assets/")
           :publishing-function org-publish-attachment
           :recursive t)
	  ("img"
           :base-directory "assets/uswds-2.10.1/"
           :base-extension "png\\|svg"
           :publishing-directory ,(concat publishing-location "assets/uswds-2.10.1/")
           :publishing-function org-publish-attachment
           :recursive t)
	  ("content"
	   :components ("page"
			"page-media"))
	  ("assets"
	   :components ("css"
			"js"
			"fonts"
			"img"))
          ("all" :components ("content" "assets")))))

(provide 'publish)
;;; publish.el ends here
Copyright 2019--2024 Marius PETER