--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/3cb3a068-a916-4bd4-925f-cd71744908dcn%40googlegroups.com.
Oz (in addition to being a dataviz tookit) has evolved into the realm of static site generation, complete with live code reloading. Simply
(require '[oz.core :as oz])
(oz/build! [{:from "site-src/pages" :to "build"}])
This will set up a filesystem watch on the site-src/pages directory (of markdown, or edn/clj files with hiccup), and every time the file changes will output compiled html to the build directory, as well as update a live view of the most recently edited page.
Note that you can specify multiple such build specifications, in case different pages need to be rendered differently (e.g. different template/layout/styling).
(defn blog-template [hiccup]
[:div {:style {:extra :styles}}
[blog-sidebar]
hiccup])
(oz/build!
[{:from "site-src/pages" :to "build"}
{:from "site-src/blog" :to "build/blog" :template-fn blog-template}])
There’s plenty more to say, but I’ll leave it for the docs:
https://github.com/metasoarous/oz#static-site-generation
To my knowledge, this is the only static site rendering framework in Clojure with live-code reloading. I’ve been thinking about extracting this functionality into a standalone library without all of the data visualization business, but it’s a bit of an invasive operation. As it stands, it’s a bit hard to discover these features amidst everything else Oz provides, so I would appreciate feedback on this.
I you try it out, please let me know how it goes for you.
Thanks
Chris