@@ -13,7 +13,7 @@
|
|||||||
"Bind to `false` to disable caching for debugging purposes."
|
"Bind to `false` to disable caching for debugging purposes."
|
||||||
true)
|
true)
|
||||||
|
|
||||||
(defn cached-content
|
(defn cached-file
|
||||||
"Return a file path after potentially regenerating the file by
|
"Return a file path after potentially regenerating the file by
|
||||||
calling `compute` with no arguments only if stale? is logical true."
|
calling `compute` with no arguments only if stale? is logical true."
|
||||||
[& {:keys [file stale? compute]}]
|
[& {:keys [file stale? compute]}]
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
[hiccup2.core :as hiccup]
|
[hiccup2.core :as hiccup]
|
||||||
[net.deertopia.doerg.html :as doerg-html]
|
[net.deertopia.doerg.html :as doerg-html]
|
||||||
[net.deertopia.publisher.slug :as slug]
|
[net.deertopia.publisher.slug :as slug]
|
||||||
|
[net.deertopia.publisher.config :as cfg]
|
||||||
[net.deertopia.publisher.roam :as roam]
|
[net.deertopia.publisher.roam :as roam]
|
||||||
[org.httpkit.server :as http]
|
[org.httpkit.server :as http]
|
||||||
[reitit.coercion]
|
[reitit.coercion]
|
||||||
@@ -38,22 +39,10 @@
|
|||||||
(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 {}
|
(let [html (-> slug slug/from-string roam/get-node
|
||||||
[:html
|
roam/org-file doerg-render/to-html)]
|
||||||
[:head
|
(-> html response/response
|
||||||
[:title "node by sluggg"]
|
(response/content-type "text/html"))))
|
||||||
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")))
|
|
||||||
|
|
||||||
(defn node-by-id [req]
|
(defn node-by-id [req]
|
||||||
(hello req))
|
(hello req))
|
||||||
|
|||||||
Reference in New Issue
Block a user