|
|
|
@ -24,8 +24,8 @@
|
|
|
|
|
(defn render-markdown [content]
|
|
|
|
|
(md/md-to-html-string content))
|
|
|
|
|
|
|
|
|
|
(defn index-page []
|
|
|
|
|
(slurp (str input-root "/structure/index.html")))
|
|
|
|
|
(defn index-template []
|
|
|
|
|
(slurp (str input-root "/index.html")))
|
|
|
|
|
|
|
|
|
|
(defn clean-name [filename]
|
|
|
|
|
(let [end (- (count filename) 3)
|
|
|
|
@ -113,9 +113,9 @@
|
|
|
|
|
{:content "dinge"})
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
(defn write-sites [context index-page sites]
|
|
|
|
|
(defn write-sites [context template sites]
|
|
|
|
|
(doseq [site sites
|
|
|
|
|
:let [translated (fill-in-placeholders context index-page site)
|
|
|
|
|
:let [translated (fill-in-placeholders context template site)
|
|
|
|
|
filename (filename (:file site))
|
|
|
|
|
destination (site-destination filename)]]
|
|
|
|
|
(spit destination translated)))
|
|
|
|
@ -132,9 +132,9 @@
|
|
|
|
|
(.mkdirs (io/file "target/page"))
|
|
|
|
|
(let [sites (md-files (str input-root "/sites"))
|
|
|
|
|
rendered-sites (map analysed-page sites)
|
|
|
|
|
index-page (index-page)
|
|
|
|
|
template (index-template)
|
|
|
|
|
context {:navcode (navcode sites)}]
|
|
|
|
|
(write-sites context index-page rendered-sites)))
|
|
|
|
|
(write-sites context template rendered-sites)))
|
|
|
|
|
|
|
|
|
|
(comment
|
|
|
|
|
(render {})
|
|
|
|
|