~subsetpark/bagatto-website

bagatto-website/blurbs/intro.md -rw-r--r-- 1.0 KiB
7fa2c251 — Zach Smith Minor refactors 4 months ago

{:title "An SSG written in Janet" :idx 0}

%%%

Bagatto is a static site generator written in Janet, a delightful and effective Lisp. Not only is it written in Janet, but site authors construct sites by writing ordinary Janet modules, with the full power of the language and ecosystem behind them:

(def data {:config {:attrs {:title "A Demo Bagatto Config"}}
           :posts {:src (bagatto/slurp-* "posts/*.md")
                   :attrs parse-post}
           :static {:src (bagatto/* "static/*")
                    :attrs bagatto/parse-base}
           :config-json {:src "config.json"
                         :attrs bagatto/parse-json}
           :config-file {:src "config.jdn"}})
(def site {:post-index {:dest index-path
                        :out render-post-index}
           :posts {:each :posts
                   :dest make-post-path
                   :out render-post}
           :static {:each :static
                    :dest make-static-path}})