7be77b31df6760b49f51d4ce2c8ca62a612f23eb
[~bandali/bndl.org] / haunt.scm
1 (use-modules (haunt asset)
2 (haunt builder blog)
3 (haunt builder atom)
4 (haunt builder assets)
5 (haunt builder rss)
6 (haunt html)
7 (haunt page)
8 (haunt post)
9 (haunt reader commonmark)
10 (haunt site)
11 (haunt utils)
12 (ice-9 match)
13 (srfi srfi-19))
14
15 (define (stylesheet name)
16 `(link (@ (rel "stylesheet")
17 (href ,(string-append "/" name ".css")))))
18
19 (define* (base-layout site body #:key title)
20 `((doctype "html")
21 (html
22 (head
23 (meta (@ (charset "utf-8")))
24 (title ,(if title (string-append title " — " (site-title site))
25 "Amin Bandali’s Personal Site"))
26 ,(stylesheet "reset")
27 ,(stylesheet "style"))
28 (body
29 (main ,body)
30 (footer
31 (p
32 "Copyright 2016–2019 Amin Bandali. See "
33 (a (@ (href "license.html")) "license.html")
34 " for license conditions. Please copy and share."))))))
35
36 (define my-date-format "~B ~d, ~Y")
37
38 (define (my-post-template post)
39 `((header
40 (h1 ,(post-ref post 'title))
41 (address "By "
42 (a (@ (href "/"))
43 ,(post-ref post 'author))
44 " <" ,(post-ref post 'email) ">")
45 (p (@ (class "date"))
46 ,(date->string (post-date post) my-date-format)))
47 ,(post-sxml post)
48 (p (@ (class "muted inbox"))
49 "Have a question or comment? Start a discussion in my "
50 (a (@ (href "https://lists.sr.ht/~bandali/public-inbox"))
51 "public inbox")
52 " by sending an email to "
53 (a (@ (href "mailto:~bandali/public-inbox@lists.sr.ht"))
54 "~bandali/public-inbox@lists.sr.ht")
55 (small
56 " ["
57 (a (@ (href "https://man.sr.ht/lists.sr.ht/etiquette.md"))
58 "mailing list etiquette")
59 "]")
60 ".")))
61
62 (define (my-collection-template site title posts prefix)
63 (define (post-uri post)
64 (string-append (or prefix "") "/"
65 (site-post-slug site post) ".html"))
66
67 `((h3 ,title)
68 (ul
69 ,@(map (lambda (post)
70 `(li
71 (a (@ (href ,(post-uri post)))
72 ,(post-ref post 'title))
73 " — " ,(date->string (post-date post) my-date-format)))
74 posts))))
75
76 (define bandali-theme
77 (theme #:name "bandali"
78 #:layout
79 (lambda (site title body)
80 (base-layout site body
81 #:title title))
82 #:post-template my-post-template
83 #:collection-template my-collection-template))
84
85 (define (static-page title file-name body)
86 (lambda (site posts)
87 (make-page file-name
88 (with-layout bandali-theme site title body)
89 sxml->html)))
90
91 (define (index-material site posts)
92 `(div
93 (h1 (@ (style "font-size: 0;"))
94 "Amin Bandali")
95 (p (@ (style "margin-top: 0;"))
96 "Hi, I’m "
97 (a (@ (href "images/bandali-with-rms.jpg")
98 (title ,(string-append
99 "photo of bandali with rms wearing a "
100 "“pay cash don’t be tracked” pin")))
101 "Amin Bandali")
102 ". I’m a graduate student at "
103 (a (@ (href "https://watform.uwaterloo.ca"))
104 "WatForm")
105 " at University of Waterloo, supervised by "
106 (a (@ (href "https://cs.uwaterloo.ca/~nday/"))
107 "Dr. Nancy Day")
108 ". The main goal of my research is improving "
109 (strong "software and systems reliability")
110 " through application of " (em "formal methods") ".")
111 (p "My research at WatForm focuses on formal logic, model "
112 "checking, and verification. I’m also interested in "
113 "programming languages, theorem provers, and their "
114 "type systems. You may wish to view my academic "
115 (a (@ (href "bandali-cv.html")) "curriculum vitae") ".")
116 (p (@ (class "notice"))
117 (strong "SE 212 students: ")
118 "see " (a (@ (href "se212-f19/")) "here") " for slides and "
119 "other material from the tutorials.")
120 (p "On the side, I dabble in "
121 (a (@ (href "https://leanprover.github.io")) "Lean")
122 " and enjoy "
123 (a (@ (href "https://stallman.org/articles/on-hacking.html"))
124 "hacking")
125 " on "
126 (a (@ (href "https://www.gnu.org/software/emacs/manual/elisp.html"))
127 "Elisp")
128 ". I’m a "
129 (a (@ (href "https://www.gnu.org/philosophy/free-sw.html"))
130 "Free Software")
131 " activist, a GNU "
132 (a (@ (href "https://www.gnu.org/people/#bandali"))
133 "maintainer")
134 " and "
135 (a (@ (href "https://www.gnu.org/people/webmeisters.html#bandali"))
136 "webmaster")
137 ", and an "
138 (a (@ (href "https://www.fsf.org/associate/"))
139 "associate member")
140 " of the " (a (@ (href "https:///www.fsf.org")
141 (title "Free Software Foundation")) "FSF")
142 ". I co-host the "
143 (a (@ (href "https://emacsel.com")) "Emacs.el")
144 " podcast with "
145 (a (@ (href "https://www.pygopar.com")) "Daniel Gopar")
146 ", and organize "
147 (a (@ (href "https://emacsconf.org")) "EmacsConf") " with help"
148 " from many wonderful people. I am also a member of the"
149 " Systems Committee for the "
150 (a (@ (href "https://csclub.uwaterloo.ca")
151 (title ,(string-append
152 "Computer Science Club of the "
153 "University of Waterloo"))) "CSC")
154 ".")
155 (p "See my " (a (@ (href "contact.html")) "contact") " page for "
156 "how to best reach me.")
157 (h2 (@ (id "papers")) "Papers")
158 (dl
159 (dt "A Comparison of the Declarative Modelling Languages B, DASH,
160 and TLA" (sup "+")
161 (small
162 " [ "
163 (a (@ (href "papers/modre2018-declarative.pdf")) "pdf")
164 " | "
165 (a (@ (href "papers/modre2018-declarative.bib")) "bib")
166 " ]"))
167 (dd "Ali Abbassi, "
168 (a (@ (href "https://bandali.eu.org")) "Amin Bandali") ", "
169 (a (@ (href "https://cs.uwaterloo.ca/~nday/"))
170 "Nancy A. Day")
171 ", and Jose Serna"
172 (br)
173 (em "2018 IEEE 8th International Model-Driven Requirements"
174 " Engineering Workshop (MoDRE)")
175 (br)
176 "Copyright © 2018 IEEE. All Rights Reserved. Sadly."))
177 (h2 (@ (id "talks")) "Talks")
178 (dl
179 (dt
180 "The Magic of Specifications and Type Systems"
181 (span (@ (class "plinks"))
182 " [ "
183 (a (@ (href "talks/cucsc-2017-slides.pdf")
184 (title ,(string-append
185 "presented at the Canadian Undergraduate"
186 " Computer Science Conference 2017,\n"
187 "University of Toronto, Canada,"
188 "June 15–17, 2017")))
189 "slides")
190 " | "
191 (a (@ (href "talks/eecs4080-poster.pdf")
192 (title ,(string-append
193 "presented at the Lassonde Undergraduate"
194 " Summer Student Research Conference,\n"
195 "York University, Toronto, Canada,"
196 "August 15, 2017")))
197 "poster")
198 " ]"))
199 (dd (a (@ (href "https://bandali.eu.org")) "Amin Bandali") ", "
200 (a (@ (href "https://github.com/cipher1024"))
201 "Simon Hudon")
202 ", "
203 (a (@ (href "http://www.cse.yorku.ca/~jonathan/"))
204 "Jonathan S. Ostroff")))
205 (h2 (@ (id "projects")) "Projects")
206 (p "Below are a number of free software projects I have worked "
207 "on:")
208 (dl
209 (dt (a (@ (href "https://git.sr.ht/~bandali/george-mode"))
210 "george-mode"))
211 (dd "Emacs major mode for editing George files")
212 (dt (a (@ (href "https://git.uwaterloo.ca/bandali/alloy-catalyst"))
213 "alloy-catalyst"))
214 (dd "Framework for performance analysis of Alloy models")
215 (dt (a (@ (href "https://github.com/unitb/unitb-web"))
216 "unitb-web"))
217 (dd "Web interface for Unit-B")
218 (dt (a (@ (href "https://github.com/unitb/tex2png-hs"))
219 "tex2png-hs"))
220 (dd "Library and CLI for converting TeX and LaTeX to PNG "
221 "images"))
222 (h2 (@ (id "notes")) "Notes")
223 (table
224 (@ (class "post-list"))
225 (tbody
226 ,@(map
227 (lambda (post)
228 (define (post-uri post)
229 (string-append "/"
230 (site-post-slug site post) ".html"))
231 `(tr
232 (td (a (@ (href ,(post-uri post)))
233 ,(post-ref post 'title)))
234 (td (@ (style "font-size: 0.875em;"))
235 ,(date->string (post-date post) my-date-format))))
236 (take-up-to 10 (posts/reverse-chronological posts)))))))
237
238 (define (index-page site posts)
239 (make-page
240 "index.html"
241 (base-layout site (index-material site posts))
242 sxml->html))
243
244 (define license-page
245 (static-page
246 "Licensing Information"
247 "license.html"
248 `((h1 "License information for bandali.eu.org")
249 (p "I strongly believe in "
250 (a (@ (href "https://questioncopyright.org/what_is_free_culture"))
251 "free culture")
252 " and that all creative works everywhere should be "
253 (a (@ (href "https://freedomdefined.org/Definition")) "free"
254 "."))
255 (p "Unless otherwise noted material on this site is licensed "
256 "under the GNU General Public License as published by the "
257 "Free Software Foundation, either version 3 of the License, "
258 "or (at your option) any later version. A copy of the "
259 "license is included at "
260 (a (@ (href "gpl-3.0.html")) "gpl-3.0.html") ".")
261 (p "Some resources on free software and licenses:")
262 (ul
263 (li (a (@ (href "https://www.gnu.org/philosophy/free-sw.html"))
264 "What is free software?"))
265 (li (a (@ (href "https://www.gnu.org/licenses/license-list.html"))
266 "Various Licenses and Comments about Them"))
267 (li (a (@ (href "https://www.gnu.org/proprietary/proprietary.html"))
268 "Proprietary Software Is Often Malware"))))))
269
270 (define my-domain "bandali.eu.org")
271
272 (site #:title "Amin Bandali"
273 #:domain my-domain
274 #:default-metadata
275 '((author . "Amin Bandali")
276 (email . "bandali@gnu.org")
277 (domain . my-domain))
278 #:readers (list commonmark-reader)
279 #:builders (list (blog #:theme bandali-theme
280 #:collections
281 `(("Notes" "notes.html"
282 ,posts/reverse-chronological)))
283 index-page
284 (atom-feed
285 #:file-name "feed.atom")
286 (atom-feeds-by-tag
287 #:prefix "tags")
288 (rss-feed
289 #:file-name "feed.rss")
290 license-page
291 (static-directory "static" "")))