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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
;; SPDX-License-Identifier: CC-BY-SA-4.0
;; Copyright 2026 bdunahu <bdunahu@operationnull.com>
(define-module (operationnull theme)
#:use-module (haunt artifact)
#:use-module (haunt builder blog)
#:use-module (haunt html)
#:use-module (haunt post)
#:use-module (haunt site)
#:use-module (ice-9 match)
#:use-module (srfi srfi-19)
#:use-module (operationnull utils)
#:export (main-theme
base-template))
(define %cc-by-sa-link
'(a (@ (href "https://creativecommons.org/licenses/by-sa/4.0/"))
"CC BY-SA 4.0"))
(define %intro
`(intro
(a (@ (class "intro-ava") (href "/")))
(div (@ (class "divider")))
(div (@ (class "intro-main"))
(div (@ (class "intro-left"))
(nav
(div (ul (li (a (@ (href "https://git.operationnull.com/"))
"git"))
(li (a (@ (href "https://codeberg.org/bdunahu"))
"codeberg"))
(li (a (@ (href "gemini://porphyrion.operationnull.com/"))
"porphyrion"))))))
(div (@ (class "intro-right"))
(nav (@ (id "umaring-id")))
(script (@ (id "umaring_js")
(src "/assets/ring.js")))))))
(define %footer
`(footer (@ (class "footer"))
,(date->string (current-date) "Content © 2024-~Y bdunahu")
", art © "
(a (@ (href "https://rottngutt.rf.gd/about.php"))
"rottngutt")
"."
(br)
"Much of this site licensed under the " ,%cc-by-sa-link ", see "
(a (@ (href "https://git.operationnull.com/operationnull.git/tree/licenses/README.org"))
"here")
"."
(br)
"Last updated on "
,(date->string (current-date) "~b ~d, ~Y")
". Generated with "
(a (@ (href "https://dthompson.us/projects/haunt.html"))
"Haunt")
" and "
(a (@ (href "https://gnu.org/software/guile"))
"Guile Scheme")
"."))
(define (first-paragraph post)
(let loop ((sxml (post-sxml post)))
(match sxml
(() '())
(((and paragraph ('p . _)) . _)
(list paragraph))
((head . tail)
(cons head (loop tail))))))
(define (stylesheet name)
`(link (@ (rel "stylesheet")
(href ,(string-append "/assets/" name ".css")))))
(define (base-template site title body)
`((doctype "html")
(head
(meta (@ (http-equiv "Content-Type") (content "text/html; charset=UTF-8")))
(meta (@ (http-equiv "Content-Language") (content "en")))
(meta (@ (name "viewport")
(content "width=device-width, initial-scale=1")))
(meta (@ (name "description")
(content "bdunahu's personal website")))
(meta (@ (name "author") (content "bdunahu")))
;; (link (@ (rel "icon")
;; (type "image/x-icon")
;; (href "/assets/favicon.ico")))
(title ,(string-append title " — " (site-title site)))
,(stylesheet "site")
,(stylesheet "xtra"))
,%intro
(body
(div (@ (class "container"))
,body))
,%footer))
(define main-theme
(theme #:name "bdunahu"
#:layout base-template
#:post-template
(lambda (post)
`((article
(h1 (@ (class "title")),(post-ref post 'title))
(div (@ (class "date"))
,(date->string (post-date post)
"created: ~B ~d, ~Y"))
(div (@ (class "tags"))
"tags:"
(ul ,@(map (lambda (tag)
`(li (a (@ (href ,(string-append "/feeds/tags/"
tag ".xml")))
,tag)))
(assq-ref (post-metadata post) 'tags))))
(div (@ (class "post"))
,(post-sxml post)))))
#:collection-template
(lambda (site title posts prefix)
`(article (h1 ,title
(a (@ (href "/atom.xml"))
(img (@ (class "feed-icon") (src "/assets/feed.png")))))
,(map (lambda (post)
(let ((uri (post-uri site post)))
`(div (@ (class "summary"))
(h3 (a (@ (href ,uri))
,(post-ref post 'title)))
(div (@ (class "date"))
,(date->string (post-date post)
"~B ~d, ~Y"))
(div (@ (class "post"))
,(first-paragraph post)))))
posts)))
#:pagination-template
(lambda (site body previous-page next-page)
`(,@body
(div (@ (class "paginator"))
,(if previous-page
`(a (@ (class "paginator-prev") (href ,previous-page))
"← Newer")
'())
,(if next-page
`(a (@ (class "paginator-next") (href ,next-page))
"Older →")
'()))))
))
|