This commit is contained in:
2026-03-21 20:02:39 -06:00
parent 46c7c5d45c
commit a8477cafbf
2 changed files with 15 additions and 17 deletions

View File

@@ -38,18 +38,18 @@
(response/content-type "text/html")))
(defn node-by-slug [{{{:keys [slug]} :path} :parameters}]
(-> (hiccup/html {}
[:html
[:head
[:title "node by sluggg"]
doerg-html/charset
doerg-html/viewport]
[:body
[:h1 "node by slug"]
[:pre
(-> slug slug/from-string roam/get-node
roam/org-file doerg-render/to-html)]]])
#_(-> slug slug/from-string roam/get-node
(-> #_(hiccup/html {}
[:html
[:head
[:title "node by sluggg"]
doerg-html/charset
doerg-html/viewport]
[:body
[:h1 "node by slug"]
[:pre
(-> slug slug/from-string roam/get-node
roam/org-file doerg-render/to-html)]]])
(-> slug slug/from-string roam/get-node
roam/org-file doerg-render/to-html)
str
response/response

View File

@@ -13,11 +13,9 @@
(try (let [decoder (Base64/getUrlDecoder)]
(when (= 16 (count (.decode decoder s)))
(Slug. s)))
(catch IllegalArgumentException e
(when (not= (ex-message e)
(str "Input byte[] should at least "
"have 2 bytes for base64 bytes"))
(throw e)))))
;; really stupid
(catch IllegalArgumentException _
nil)))
(defn to-string [s]
(str s))