summaryrefslogtreecommitdiff
path: root/src/pages.clj
blob: 4b9a61796108b11fb477600d85e6c0a9e5e99eda (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
(ns pages
  (:require [borkdude.html :refer [html]]))

(def home-uri "/")
(def books-2025-uri "/books-2025")

(defn template [body]
  (html
   [:html
    {:style {:font-family "monospace"}}
    [:head
     [: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 "2025 reading list"]])]])))

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

(defn books-2025
  []
  (page
   (html
    [:<>
     [:h1 "Incomplete 2025 reading list"]
     [:ul
      [: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 "Mating (Normal Rush)"]]])))

(defn pages []
  {home-uri home
   books-2025-uri books-2025})

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