Bagatto

A transparent, extensible static site generator

An SSG written in Janet

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}})

Transparent

Bagatto exposes the native terms of the Janet programming language to site authors and relies on ordinary functions to generate output values. This approach, rather than asking authors to define their sites using a configuration language, means that the machinery that produces your website is always available and inspectable. There is no hidden functionality.

No Magic

Bagatto will never do something in an indirect, non-obvious way in the name of convenience. Things like normally-namespaced functions, accepting a filename on the command line, and compatibility with jpm are examples of how a straightforward, non-magic interface can be elegant and enjoyable.

Fast

Bagatto is surprisingly fast. It makes intelligent use of multithreading and caching to quickly process files with many different sources and outputs, and there’s no start-up overhead.

Il Mago, the Bagatto Logo