summaryrefslogtreecommitdiff
path: root/src/pages.clj
blob: ced44989329d601a0c8deedf97131a222e52ec33 (plain)
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
(ns pages
  (:require [borkdude.html :refer [html]]
            [highlight :refer [code highlight-clj highlight-styles]]))

(def home-uri "/")
(def books-2025-uri "/books-2025")
(def past-work-uri "/past-work")
(def code-example-uri "/code-example")

(defn template [body]
  (html
   [:html
    {:style {:font-family "monospace"}}
    [:head
     [:style
      [:$
       (str
        (highlight-styles "default")
        "li { line-height: 1.6; }")]]
     [:meta {:charset "UTF-8"}]]
    [:body
     [:<> body]]]))

(defn home []
  (template
   (html
    [:<>
     [:p "Hello."]
     [:p "My name is Jake Zerrer. This is where I keep things online. Look around."]
     [:ul
      (map
       (fn [[uri name]]
         (html
          [:li [:a {:href (str uri)} name]]))
       [[books-2025-uri "Selected reading list, 2025"]
        [past-work-uri "Past work"]])]])))

(defn page [body]
  (template
   (html
    [:<>
     [:p [:a {:href "/"} "< home"]]
     body])))

(defn books-2025
  []
  (page
   (html
    [:<>
     [:h1 "Selected reading list, 2025"]
     [:ul
      [:li "The Second Sex (Simone de Beauvior)"]
      [:li "The Places in Between (Rory Stewart)"]
      [:li "Either/Or: A Fragment of Life (Søren Kierkegaard)"]
      [:li "The Philosophy of History (G. W. F. Hegel)"]
      [:li "This Life: Secular Faith and Spiritual Freedom (Martin Hägglund)"]
      [:li "The Power Broker (Robert Caro)"]
      [:li "Mating (Normal Rush)"]]])))

(defn past-work
  []
  (page
   (html
    [:<>
     [:h1 "Past work"]
     [:p "I have spent most of my professional life working as a software engineer:"]
     [:ul
      [:li "In 2024, I ran product engineering at Normal Computing"]
      [:li "In the summer of 2023, I traveled and prototyped a devex tool called refuge"]
      [:li "From 2018 to 2023, I worked as a software engineer at Flexport"]
      [:li "From 2014 to 2017, I worked as a software engineer at a small startup"]]
     [:p "I had a previous career as a theatrical sound designer in New York City."]])))

(defn code-example []
  (page
   (html
    [:<>
     [:h1 "Code example"]
     [:p "This is an example of a post with a code block:"]
     (code
      (highlight-clj
       (println "hello, world!")))
     [:p "Looks pretty good."]])))

(defn e-404 []
  (page
   (html
    [:<>
     [:h1 "404 Oh, be some other path!"]
     [:p "What's in a path? That which we call a page"
      [:br]
      "by any other path would fail to load"]])))

(defn pages []
  {home-uri home
   books-2025-uri books-2025
   code-example-uri code-example
   past-work-uri past-work})

(comment
  (require '[repl :refer [restart build]])
  (restart)
  (build))