Last active
November 10, 2016 15:21
-
-
Save deadghost/623cbef91e16bc0cda60001fdc6ad23a to your computer and use it in GitHub Desktop.
Library that I wish existed for clojure HTML templating
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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