Skip to content

Commit

Permalink
Fixing links
Browse files Browse the repository at this point in the history
  • Loading branch information
abedra committed May 5, 2011
1 parent 10e0487 commit c63349e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/labrepl.clj
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
:rock-paper-scissors])

(defn home []
(layout/page
[:h2.logo "Clojure Labs"]
(layout/home
[:ul
(map
(fn [lab] [:li (make-url lab)])
Expand All @@ -37,7 +36,7 @@

(defroutes lab-routes
(GET "/" [] (home))
(GET "/labs/:name" [name] (layout/page [:h2 name] (instructions name)))
(GET "/labs/:name" [name] (layout/lab [:h2 name] (instructions name)))
(route/files "/")
(route/not-found "<h1>Not Found</h1>"))

Expand Down
13 changes: 11 additions & 2 deletions src/labrepl/layout.clj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,17 @@
"/javascripts/shCore.js"
"/javascripts/shBrushClojure.js"])

(defn page [title & body]
(defn home [body]
(html
[:head
[:title "Clojure Labs"]
(apply include-css default-stylesheets)
(apply include-js default-javascripts)]
[:body [:div {:id "header"} [:h2.logo "Clojure Labs"]]
[:div {:id "content"} body]
[:div {:id "footer"} "Clojure labrepl. Copyright Relevance Inc. All Rights Reserved."]]))

(defn lab [title & body]
{:pre [(string? (last title))]}
(html
[:head
Expand All @@ -25,4 +35,3 @@
[:div {:id "breadcrumb"} (link-to "/" "Home")]
body]
[:div {:id "footer"} "Clojure labrepl. Copyright Relevance Inc. All Rights Reserved."]]))

0 comments on commit c63349e

Please sign in to comment.