diff options
author | David Barksdale <amatus.amongus@gmail.com> | 2012-04-03 00:03:45 -0500 |
---|---|---|
committer | David Barksdale <amatus.amongus@gmail.com> | 2012-04-03 00:03:45 -0500 |
commit | 34980521688b836c82b4bff3bc3952c6af25043d (patch) | |
tree | 2962247326b091bbc2dc65a27d64921d556f2d98 /src |
lein noir new ctf-website
Diffstat (limited to 'src')
-rw-r--r-- | src/ctf_website/server.clj | 11 | ||||
-rw-r--r-- | src/ctf_website/views/common.clj | 12 | ||||
-rw-r--r-- | src/ctf_website/views/welcome.clj | 9 |
3 files changed, 32 insertions, 0 deletions
diff --git a/src/ctf_website/server.clj b/src/ctf_website/server.clj new file mode 100644 index 0000000..d6dd776 --- /dev/null +++ b/src/ctf_website/server.clj @@ -0,0 +1,11 @@ +(ns ctf-website.server + (:require [noir.server :as server])) + +(server/load-views "src/ctf_website/views/") + +(defn -main [& m] + (let [mode (keyword (or (first m) :dev)) + port (Integer. (get (System/getenv) "PORT" "8080"))] + (server/start port {:mode mode + :ns 'ctf-website}))) + diff --git a/src/ctf_website/views/common.clj b/src/ctf_website/views/common.clj new file mode 100644 index 0000000..7f0712e --- /dev/null +++ b/src/ctf_website/views/common.clj @@ -0,0 +1,12 @@ +(ns ctf-website.views.common + (:use [noir.core :only [defpartial]] + [hiccup.page-helpers :only [include-css html5]])) + +(defpartial layout [& content] + (html5 + [:head + [:title "ctf-website"] + (include-css "/css/reset.css")] + [:body + [:div#wrapper + content]])) diff --git a/src/ctf_website/views/welcome.clj b/src/ctf_website/views/welcome.clj new file mode 100644 index 0000000..bac17db --- /dev/null +++ b/src/ctf_website/views/welcome.clj @@ -0,0 +1,9 @@ +(ns ctf-website.views.welcome + (:require [ctf-website.views.common :as common] + [noir.content.getting-started]) + (:use [noir.core :only [defpage]] + [hiccup.core :only [html]])) + +(defpage "/welcome" [] + (common/layout + [:p "Welcome to ctf-website"])) |