Commits

Lucian Brănescu-Mihăilă committed 870c527

Initial commit with noir.

Comments (0)

Files changed (5)

+# lichen
+
+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.
+
+(defproject lichen "0.1.0-SNAPSHOT"
+            :description "FIXME: write this!"
+            :dependencies [[org.clojure/clojure "1.3.0"]
+                           [noir "1.2.1"]]
+            :main lichen.server)
+

src/lichen/server.clj

+(ns lichen.server
+  (:require [noir.server :as server]))
+
+(server/load-views "src/lichen/views/")
+
+(defn -main [& m]
+  (let [mode (keyword (or (first m) :dev))
+        port (Integer. (get (System/getenv) "PORT" "8080"))]
+    (server/start port {:mode mode
+                        :ns 'lichen})))
+

src/lichen/views/common.clj

+(ns lichen.views.common
+  (:use [noir.core :only [defpartial]]
+        [hiccup.page-helpers :only [include-css html5]]))
+
+(defpartial layout [& content]
+            (html5
+              [:head
+               [:title "lichen"]
+               (include-css "/css/reset.css")]
+              [:body
+               [:div#wrapper
+                content]]))

src/lichen/views/welcome.clj

+(ns lichen.views.welcome
+  (:require [lichen.views.common :as common]
+            [noir.content.getting-started])
+  (:use [noir.core :only [defpage]]
+        [hiccup.core :only [html]]))
+
+(defpage "/welcome" []
+         (common/layout
+           [:p "Welcome to lichen"]))