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