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 |
lein noir new ctf-website
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | README.md | 17 | ||||
-rw-r--r-- | project.clj | 6 | ||||
-rw-r--r-- | resources/public/css/reset.css | 57 | ||||
-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 |
7 files changed, 117 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b8c1b21 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +pom.xml +*jar +/lib/ +/classes/ +.lein-deps-sum diff --git a/README.md b/README.md new file mode 100644 index 0000000..d0c0cf1 --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +# ctf-website + +A website written in noir. + +## Usage + +```bash +lein deps +lein run +``` + +## License + +Copyright (C) 2011 FIXME + +Distributed under the Eclipse Public License, the same as Clojure. + diff --git a/project.clj b/project.clj new file mode 100644 index 0000000..6f93443 --- /dev/null +++ b/project.clj @@ -0,0 +1,6 @@ +(defproject ctf-website "0.1.0-SNAPSHOT" + :description "FIXME: write this!" + :dependencies [[org.clojure/clojure "1.3.0"] + [noir "1.2.1"]] + :main ctf-website.server) + diff --git a/resources/public/css/reset.css b/resources/public/css/reset.css new file mode 100644 index 0000000..3af4882 --- /dev/null +++ b/resources/public/css/reset.css @@ -0,0 +1,57 @@ +html { + margin:0; + padding:0; + border:0; +} + +body, div, span, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, code, +del, dfn, em, img, q, dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, dialog, figure, footer, header, +hgroup, nav, section { + margin: 0; + padding: 0; + border: 0; + font-weight: inherit; + font-style: inherit; + font-size: 100%; + font-family: inherit; + vertical-align: baseline; +} + +article, aside, dialog, figure, footer, header, +hgroup, nav, section { + display:block; +} + +body { + line-height: 1.5; + background: white; +} + +table { + border-collapse: separate; + border-spacing: 0; +} + +caption, th, td { + text-align: left; + font-weight: normal; + float:none !important; +} +table, th, td { + vertical-align: middle; +} + +blockquote:before, blockquote:after, q:before, q:after { content: ''; } +blockquote, q { quotes: "" ""; } + +a img { border: none; } + +/*:focus { outline: 0; }*/ + + + 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"])) |