replace uses of `a' with my more convenient `aa' wrapper
[~bandali/bndl.org] / haunt.scm
CommitLineData
85314da0
AB
1(use-modules (haunt asset)
2 (haunt builder blog)
3 (haunt builder atom)
4 (haunt builder assets)
99ac860d 5 (haunt builder rss)
85314da0
AB
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
455bb137
AB
19(define* (aa content #:optional (uri content) . title)
20 `(a (@ (href ,uri) (title ,(apply string-append title))) ,content))
21
85314da0
AB
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
455bb137 35 "Copyright 2016–2019 Amin Bandali. See " ,(aa "license.html")
85314da0
AB
36 " for license conditions. Please copy and share."))))))
37
cd5ad35b
AB
38(define my-date-format "~B ~d, ~Y")
39
40(define (my-post-template post)
85314da0
AB
41 `((header
42 (h1 ,(post-ref post 'title))
455bb137 43 (address "By " ,(aa (post-ref post 'author) "/")
85314da0
AB
44 " <" ,(post-ref post 'email) ">")
45 (p (@ (class "date"))
cd5ad35b 46 ,(date->string (post-date post) my-date-format)))
90169139
AB
47 ,(post-sxml post)
48 (p (@ (class "muted inbox"))
49 "Have a question or comment? Start a discussion in my "
455bb137 50 ,(aa "public inbox" "https://lists.sr.ht/~bandali/public-inbox")
90169139 51 " by sending an email to "
455bb137
AB
52 ,(aa "~bandali/public-inbox@lists.sr.ht"
53 "mailto:~bandali/public-inbox@lists.sr.ht")
90169139 54 (small
455bb137
AB
55 " [" ,(aa "mailing list etiquette"
56 "https://man.sr.ht/lists.sr.ht/etiquette.md") "]")
90169139 57 ".")))
85314da0 58
cd5ad35b 59(define (my-collection-template site title posts prefix)
85314da0
AB
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
455bb137
AB
68 ,(aa (post-ref post 'title) (post-uri post))
69 " — "
70 ,(date->string (post-date post) my-date-format)))
85314da0
AB
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))
cd5ad35b
AB
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)))
85314da0
AB
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 "
455bb137
AB
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")
85314da0 97 ". I’m a graduate student at "
455bb137 98 ,(aa "WatForm" "https://watform.uwaterloo.ca")
85314da0 99 " at University of Waterloo, supervised by "
455bb137 100 ,(aa "Dr. Nancy Day" "https://cs.uwaterloo.ca/~nday/")
85314da0
AB
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 "
455bb137 108 ,(aa "curriculum vitae" "bandali-cv.html") ".")
85314da0
AB
109 (p (@ (class "notice"))
110 (strong "SE 212 students: ")
455bb137
AB
111 "see " ,(aa "here" "se212-f19/") " for slides and other "
112 "material from the tutorials.")
85314da0 113 (p "On the side, I dabble in "
455bb137
AB
114 ,(aa "Lean" "https://leanprover.github.io") " and enjoy "
115 ,(aa "hacking" "https://stallman.org/articles/on-hacking.html")
85314da0 116 " on "
455bb137
AB
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")
99ac860d 121 " activist, a GNU "
455bb137 122 ,(aa "maintainer" "https://www.gnu.org/people/#bandali")
85314da0 123 " and "
455bb137
AB
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")
85314da0 137 ".")
455bb137
AB
138 (p "See my " ,(aa "contact" "contact.html") " page for how to "
139 "best reach me.")
85314da0
AB
140 (h2 (@ (id "papers")) "Papers")
141 (dl
142 (dt "A Comparison of the Declarative Modelling Languages B, DASH,
143 and TLA" (sup "+")
90169139 144 (small
455bb137
AB
145 " [ " ,(aa "pdf" "papers/modre2018-declarative.pdf") " | "
146 ,(aa "bib" "papers/modre2018-declarative.bib") " ]"))
85314da0 147 (dd "Ali Abbassi, "
455bb137
AB
148 ,(aa "Amin Bandali" "https://bandali.eu.org") ", "
149 ,(aa "Nancy A. Day" "https://cs.uwaterloo.ca/~nday/") ", "
150 "Jose Serna"
85314da0
AB
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"
455bb137
AB
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/")))
85314da0
AB
176 (h2 (@ (id "projects")) "Projects")
177 (p "Below are a number of free software projects I have worked "
178 "on:")
179 (dl
455bb137 180 (dt ,(aa "george-mode" "https://git.sr.ht/~bandali/george-mode"))
85314da0 181 (dd "Emacs major mode for editing George files")
455bb137
AB
182 (dt ,(aa "alloy-catalyst"
183 "https://git.uwaterloo.ca/bandali/alloy-catalyst"))
85314da0 184 (dd "Framework for performance analysis of Alloy models")
455bb137 185 (dt ,(aa "unitb-web" "https://github.com/unitb/unitb-web"))
85314da0 186 (dd "Web interface for Unit-B")
455bb137 187 (dt ,(aa "tex2png-hs" "https://github.com/unitb/tex2png-hs"))
85314da0
AB
188 (dd "Library and CLI for converting TeX and LaTeX to PNG "
189 "images"))
190 (h2 (@ (id "notes")) "Notes")
60d388df
AB
191 (table
192 (@ (class "post-list"))
193 (tbody
85314da0
AB
194 ,@(map
195 (lambda (post)
196 (define (post-uri post)
197 (string-append "/"
198 (site-post-slug site post) ".html"))
60d388df 199 `(tr
455bb137 200 (td ,(aa (post-ref post 'title) (post-uri post)))
60d388df 201 (td (@ (style "font-size: 0.875em;"))
cd5ad35b 202 ,(date->string (post-date post) my-date-format))))
60d388df 203 (take-up-to 10 (posts/reverse-chronological posts)))))))
85314da0
AB
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
cd5ad35b
AB
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 "
455bb137
AB
217 ,(aa "free culture"
218 "https://questioncopyright.org/what_is_free_culture")
cd5ad35b 219 " and that all creative works everywhere should be "
455bb137 220 ,(aa "free" "https://freedomdefined.org/Definition") ".")
cd5ad35b
AB
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 "
455bb137 225 "license is included at " ,(aa "gpl-3.0.html") ".")
cd5ad35b
AB
226 (p "Some resources on free software and licenses:")
227 (ul
455bb137
AB
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"))))))
cd5ad35b 234
85314da0
AB
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
99ac860d
AB
249 (atom-feed
250 #:file-name "feed.atom")
251 (atom-feeds-by-tag
252 #:prefix "tags")
253 (rss-feed
254 #:file-name "feed.rss")
cd5ad35b 255 license-page
85314da0 256 (static-directory "static" "")))