From 674882c38dc2bd5aa186f94d58b085fc0aaf486b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Madeleine=20Sydney=20=C5=9Alaga?= Date: Sat, 21 Mar 2026 20:33:09 -0600 Subject: [PATCH] --- .../net/deertopia/publisher/cached_file.clj | 2 +- .../src/net/deertopia/publisher/server.clj | 21 +++++-------------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/publisher/src/net/deertopia/publisher/cached_file.clj b/publisher/src/net/deertopia/publisher/cached_file.clj index bce16eb..515271d 100644 --- a/publisher/src/net/deertopia/publisher/cached_file.clj +++ b/publisher/src/net/deertopia/publisher/cached_file.clj @@ -13,7 +13,7 @@ "Bind to `false` to disable caching for debugging purposes." true) -(defn cached-content +(defn cached-file "Return a file path after potentially regenerating the file by calling `compute` with no arguments only if stale? is logical true." [& {:keys [file stale? compute]}] diff --git a/publisher/src/net/deertopia/publisher/server.clj b/publisher/src/net/deertopia/publisher/server.clj index e9e9a37..6373d7c 100644 --- a/publisher/src/net/deertopia/publisher/server.clj +++ b/publisher/src/net/deertopia/publisher/server.clj @@ -4,6 +4,7 @@ [hiccup2.core :as hiccup] [net.deertopia.doerg.html :as doerg-html] [net.deertopia.publisher.slug :as slug] + [net.deertopia.publisher.config :as cfg] [net.deertopia.publisher.roam :as roam] [org.httpkit.server :as http] [reitit.coercion] @@ -38,22 +39,10 @@ (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 - roam/org-file doerg-render/to-html) - str - response/response - (response/content-type "text/html"))) + (let [html (-> slug slug/from-string roam/get-node + roam/org-file doerg-render/to-html)] + (-> html response/response + (response/content-type "text/html")))) (defn node-by-id [req] (hello req))