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

View File

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