summaryrefslogtreecommitdiff
path: root/src/pages.clj
diff options
context:
space:
mode:
authorJake Zerrer <him@jakezerrer.com>2025-08-12 14:29:25 -0400
committerJake Zerrer <him@jakezerrer.com>2025-08-12 14:29:25 -0400
commit71a4c2823a41febd0778c7170eb3b12b293b4f49 (patch)
treee1800b6fca9cfe122221a7a490e580118c818769 /src/pages.clj
parente7583ac9782b006139188ebe6a3c2d33b980bf33 (diff)
Add code block support
Diffstat (limited to 'src/pages.clj')
-rw-r--r--src/pages.clj21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/pages.clj b/src/pages.clj
index 4b9a617..bd9cad2 100644
--- a/src/pages.clj
+++ b/src/pages.clj
@@ -1,14 +1,19 @@
(ns pages
- (:require [borkdude.html :refer [html]]))
+ (:require [borkdude.html :refer [html]]
+ [highlight :refer [code highlight-clj highlight-styles]]))
(def home-uri "/")
(def books-2025-uri "/books-2025")
+(def code-example-uri "/code-example")
(defn template [body]
(html
[:html
{:style {:font-family "monospace"}}
[:head
+ [:style
+ [:$
+ (highlight-styles "default")]]
[:meta {:charset "UTF-8"}]]
[:body
[:<> body]]]))
@@ -46,9 +51,21 @@
[:li "This Life: Secular Faith and Spiritual Freedom (Martin Hägglund)"]
[:li "Mating (Normal Rush)"]]])))
+(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 pages []
{home-uri home
- books-2025-uri books-2025})
+ books-2025-uri books-2025
+ code-example-uri code-example})
(comment
(require '[repl :refer [restart build]])