Skip to content

Instantly share code, notes, and snippets.

@samflores
Created September 4, 2012 16:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samflores/3623177 to your computer and use it in GitHub Desktop.
Save samflores/3623177 to your computer and use it in GitHub Desktop.
(defn render [template data partials]
(render-resource
(str "templates/" template ".mustache")
data
(reduce #(assoc %1 %2 (slurp (io/resource (str "templates/" %2 ".mustache")))) {} partials)))
(render "index" {:name "John Smith"} '[header footer])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment