Commit 504e8fbde8

504e8fbde8597648bc56b9c8c2ffd3dbc8496529

parent: 86b90a2768

Unsigned

cmc <hello@cleberg.net> · 2024-10-31 14:58 UTC

format publish script

Layout: unified · split

publish.el +19 −13
@@ -1,22 +1,26 @@
1;; explicity load packages since I'm using Doom Emacs
1;; Explicitly load packages for Doom Emacs
2
23(add-to-list 'load-path "~/.emacs.d/.local/straight/repos/emacs-htmlize")
34(add-to-list 'load-path "~/.emacs.d/.local/straight/repos/weblorg")
45(add-to-list 'load-path "~/.emacs.d/.local/straight/repos/templatel")
6
57(require 'htmlize)
68(require 'weblorg)
79
8;; defaults to http://localhost:8000
9;; ENV=prod emacs --script publish.el
10;; Set default URL for Weblorg
1011(if (string= (getenv "ENV") "prod")
1112 (setq weblorg-default-url "https://cleberg.net"))
1213
14;; Define site configuration
1315(weblorg-site
1416 :theme nil
15 :template-vars '(("site_name" . "cleberg.net")
17 :template-vars `(("site_name" . "cleberg.net")
1618 ("site_owner" . "Christian Cleberg <hello@cleberg.net>")
1719 ("site_description" . "Just a blip of ones and zeroes.")))
1820
19;; route for rendering the index page of the website
21;; Define routes for rendering content
22
23;; Index page route
2024(weblorg-route
2125 :name "index"
2226 :input-pattern "content/index.org"
@@ -24,7 +28,7 @@
2428 :output ".build/index.html"
2529 :url "/")
2630
27;; route for rendering each post
31;; Blog post route
2832(weblorg-route
2933 :name "blog"
3034 :input-pattern "content/blog/*.org"
@@ -32,7 +36,7 @@
3236 :output ".build/blog/{{ slug }}.html"
3337 :url "/blog/{{ slug }}.html")
3438
35;; route for rendering the index page of the blog
39;; Blog index page route
3640(weblorg-route
3741 :name "blog-index"
3842 :input-pattern "content/blog/*.org"
@@ -41,7 +45,7 @@
4145 :output ".build/blog/index.html"
4246 :url "/blog/")
4347
44;; route for rendering each wiki post
48;; Wiki post route
4549(weblorg-route
4650 :name "wiki"
4751 :input-pattern "content/wiki/*.org"
@@ -49,7 +53,7 @@
4953 :output ".build/wiki/{{ slug }}.html"
5054 :url "/wiki/{{ slug }}.html")
5155
52;; route for rendering the index page of the wiki
56;; Wiki index page route
5357(weblorg-route
5458 :name "wiki-index"
5559 :input-pattern "content/wiki/*.org"
@@ -58,7 +62,7 @@
5862 :output ".build/wiki/index.html"
5963 :url "/wiki/")
6064
61;; route for rendering each page
65;; Page post route
6266(weblorg-route
6367 :name "pages"
6468 :input-pattern "content/*.org"
@@ -66,6 +70,7 @@
6670 :output ".build/{{ slug }}.html"
6771 :url "/{{ slug }}.html")
6872
73;; Salary page route
6974(weblorg-route
7075 :name "salary"
7176 :input-pattern "content/salary/*.org"
@@ -73,6 +78,7 @@
7378 :output ".build/salary/{{ slug }}.html"
7479 :url "/salary/{{ slug }}.html")
7580
81;; Services page route
7682(weblorg-route
7783 :name "services"
7884 :input-pattern "content/services/*.org"
@@ -80,7 +86,7 @@
8086 :output ".build/services/{{ slug }}.html"
8187 :url "/services/{{ slug }}.html")
8288
83;; RSS Feed
89;; RSS feed route
8490(weblorg-route
8591 :name "rss"
8692 :input-pattern "content/blog/*.org"
@@ -89,10 +95,10 @@
8995 :output ".build/feed.xml"
9096 :url "/feed.xml")
9197
92;; route for static assets that also copies files to .build directory
98;; Copy static assets and output to .build directory
9399(weblorg-copy-static
94100 :output ".build/{{ file }}"
95101 :url "/{{ file }}")
96102
97;; fire the engine and export all the files declared in the routes above
103;; Export all content using Weblorg engine
98104(weblorg-export)