|
|
|
@ -95,16 +95,17 @@
|
|
|
|
|
(particles-in-content "asd &particle:hullu"))
|
|
|
|
|
|
|
|
|
|
(defn fill-in-placeholders [context html page]
|
|
|
|
|
(let [nav+content (-> html
|
|
|
|
|
(string/replace #"&nav" (:navcode context))
|
|
|
|
|
(string/replace #"&content" (:content page)))
|
|
|
|
|
particles (particles-in-content nav+content)]
|
|
|
|
|
(let [simple (-> html
|
|
|
|
|
(string/replace #"&nav" (:navcode context))
|
|
|
|
|
(string/replace #"&content" (:content page))
|
|
|
|
|
(string/replace #"&title" (get-in page [:metadata :title])))
|
|
|
|
|
particles (particles-in-content simple)]
|
|
|
|
|
(reduce (fn [result particle]
|
|
|
|
|
(println particle)
|
|
|
|
|
(string/replace result
|
|
|
|
|
(first particle)
|
|
|
|
|
(particle-content (second particle))))
|
|
|
|
|
nav+content
|
|
|
|
|
simple
|
|
|
|
|
particles)))
|
|
|
|
|
|
|
|
|
|
(comment
|
|
|
|
@ -129,7 +130,7 @@
|
|
|
|
|
(defn render
|
|
|
|
|
"Renders all markdown pages under resources/user using the structure in resources/user/structure to target/page"
|
|
|
|
|
[project]
|
|
|
|
|
(.mkdir (io/file "target/page"))
|
|
|
|
|
(.mkdirs (io/file "target/page"))
|
|
|
|
|
(let [sites (md-files (str input-root "/sites"))
|
|
|
|
|
rendered-sites (map analysed-page sites)
|
|
|
|
|
index-page (index-page)
|
|
|
|
|