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