diff --git a/project.clj b/project.clj index 9a0b319..7229c49 100644 --- a/project.clj +++ b/project.clj @@ -6,6 +6,7 @@ :dependencies [[cheshire "5.5.0"] [prismatic/schema "1.0.4"] + [hiccup "1.0.5"] [cljs-ajax "0.5.5"] [secretary "1.2.3"]] diff --git a/src/webtools/page.clj b/src/webtools/page.clj new file mode 100644 index 0000000..94cf6cf --- /dev/null +++ b/src/webtools/page.clj @@ -0,0 +1,24 @@ +(ns webtools.page + (:require + [clojure.string :as string] + [hiccup.core :refer [html]] + [hiccup.page :refer [doctype]] + [hiccup.element :refer [javascript-tag]])) + +(defn html5 + [& contents] + (html + {:mode :html} + (doctype :html5) + (-> ["" + "" + "" "" ""] + (concat contents) + (concat [""])))) + +(defn js-env-settings + [context-url dev?] + (javascript-tag + (string/join "\n" + [(str "var __context = '" context-url "';") + (str "var __isDev = " (boolean dev?) ";")])))