26 lines
704 B
Janet
26 lines
704 B
Janet
(import janet-html :as html)
|
|
(import spork/netrepl)
|
|
|
|
(import ./views)
|
|
(import ./utils)
|
|
|
|
# disable pretty-printing
|
|
|
|
(setdyn :pretty-format "%.20q")
|
|
|
|
# ---
|
|
# site config
|
|
# ---
|
|
|
|
(bagatto/set-output-dir! "site")
|
|
|
|
(def data {:config {:attrs {:title "arnes.space"}}
|
|
:posts {:src (bagatto/slurp-* "posts/*.md")
|
|
:attrs bagatto/parse-mmarkdown}})
|
|
|
|
(def site {:index {:dest "index.html"
|
|
:out (views/base data [:h1 "Hello World!"])}
|
|
:posts {:each :posts
|
|
:dest (bagatto/%p "posts" '%i "title" '% ".html")
|
|
:out (fn [data item]
|
|
(views/base data (bagatto/mmarkdown->html (item :contents)) true))}})
|