publish.el
111 lines · 2806 bytes
1;; Explicitly load packages for Doom Emacs
2(add-to-list 'load-path "~/.config/emacs/.local/straight/repos/emacs-htmlize")
3(add-to-list 'load-path "~/.config/emacs/.local/straight/repos/weblorg")
4(add-to-list 'load-path "~/.config/emacs/.local/straight/repos/templatel")
5
6(require 'htmlize)
7(require 'weblorg)
8
9;; Set default URL for Weblorg
10(if (string= (getenv "ENV") "prod")
11 (setq weblorg-default-url "https://cleberg.net"))
12
13;; Define site configuration
14(weblorg-site
15 :theme nil
16 :template-vars '(("site_name" . "cleberg.net")
17 ("site_owner" . "Christian Cleberg <hello@cleberg.net>")
18 ("site_description" . "Just a blip of ones and zeroes.")))
19
20;; Define routes for rendering content
21
22;; Index page route
23(weblorg-route
24 :name "index"
25 :input-pattern "content/*.org"
26 :template "index.html"
27 :output ".build/index.html"
28 :url "/")
29
30;; Blog post route
31(weblorg-route
32 :name "blog"
33 :input-pattern "content/blog/*.org"
34 :template "post.html"
35 :output ".build/blog/{{ slug }}.html"
36 :url "/blog/{{ slug }}.html")
37
38;; Blog index page route
39(weblorg-route
40 :name "blog-index"
41 :input-pattern "content/blog/*.org"
42 :input-aggregate #'weblorg-input-aggregate-all-desc
43 :template "blog.html"
44 :output ".build/blog/index.html"
45 :url "/blog/")
46
47;; Wiki post route
48(weblorg-route
49 :name "wiki"
50 :input-pattern "content/wiki/*.org"
51 :template "post.html"
52 :output ".build/wiki/{{ slug }}.html"
53 :url "/wiki/{{ slug }}.html")
54
55;; Wiki index page route
56(weblorg-route
57 :name "wiki-index"
58 :input-pattern "content/wiki/*.org"
59 :input-aggregate #'weblorg-input-aggregate-all
60 :template "wiki.html"
61 :output ".build/wiki/index.html"
62 :url "/wiki/")
63
64;; Page post route
65(weblorg-route
66 :name "pages"
67 :input-pattern "content/*.org"
68 :template "page.html"
69 :output ".build/{{ slug }}.html"
70 :url "/{{ slug }}.html")
71
72;; Salary page route
73(weblorg-route
74 :name "salary"
75 :input-pattern "content/salary/*.org"
76 :template "page.html"
77 :output ".build/salary/{{ slug }}.html"
78 :url "/salary/{{ slug }}.html")
79
80;; Services page route
81(weblorg-route
82 :name "services"
83 :input-pattern "content/services/*.org"
84 :template "page.html"
85 :output ".build/services/{{ slug }}.html"
86 :url "/services/{{ slug }}.html")
87
88;; Now page route
89(weblorg-route
90 :name "now"
91 :input-pattern "content/now/*.org"
92 :template "post.html"
93 :output ".build/now/{{ slug }}.html"
94 :url "/now/{{ slug }}.html")
95
96;; RSS feed route
97(weblorg-route
98 :name "rss"
99 :input-pattern "content/blog/*.org"
100 :input-aggregate #'weblorg-input-aggregate-all-desc
101 :template "feed.xml"
102 :output ".build/feed.xml"
103 :url "/feed.xml")
104
105;; Copy static assets and output to .build directory
106(weblorg-copy-static
107 :output ".build/{{ file }}"
108 :url "/{{ file }}")
109
110;; Export all content using Weblorg engine
111(weblorg-export)