Skip to content

Instantly share code, notes, and snippets.

@deadghost
Last active November 10, 2016 15:21
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 deadghost/623cbef91e16bc0cda60001fdc6ad23a to your computer and use it in GitHub Desktop.
Save deadghost/623cbef91e16bc0cda60001fdc6ad23a to your computer and use it in GitHub Desktop.
Library that I wish existed for clojure HTML templating
;; Library that I wish existed for HTML templating
(def base-html
[:html
[:head]
[:body
[:div {:id "id-name"}]]])
(def index-page
"Wishful Thinking."
(-> base-html
(magic/append [:head] [:title "My Appended Site's Title"])
(magic/after [:#id-name]
[:footer
[:p "My footer info here."]])))
;; [:html
;; [:head
;; [:title "My Appended Site's Title"]]
;; [:body
;; [:div {:id "id-name"}]
;; [:footer
;; [:p "My footer info here."]]]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment