-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpublish.el
47 lines (40 loc) · 1 KB
/
publish.el
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
;;; publish.el --- Generate Weblorg page
;;; Commentary:
;;
;; Generate static website for weblorg
;;
;;; Code:
;;
;; Setup package management
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
;; Install and configure dependencies
(use-package templatel)
(use-package htmlize)
(use-package weblorg)
;; Defaults to localhost:8000
(if (string= (getenv "ENV") "prod")
(setq weblorg-default-url "https://emacs.love/tales"))
;; Generate index
(weblorg-route
:name "index"
:input-pattern "tales/*.org"
:input-aggregate #'weblorg-input-aggregate-all-desc
:template "index.html"
:output "index.html"
:url "/")
(weblorg-route
:name "tale"
:input-pattern "tales/*.org"
:template "tale.html"
:output "{{ slug }}.html"
:url "/{{ slug }}.html")
(weblorg-route
:name "static"
:url "/static/{{ file }}")
(weblorg-export)
;;; publish.el ends here