Browse Source

gencss lib added

master
Christian Mueller 14 years ago
parent
commit
55359aa594
  1. 3
      project.clj
  2. 6
      src/NoteHub/views/common.clj
  3. 9
      src/NoteHub/views/pages.clj
  4. 9
      src/NoteHub/views/welcome.clj

3
project.clj

@ -1,6 +1,7 @@
(defproject NoteHub "0.1.0-SNAPSHOT" (defproject NoteHub "0.1.0-SNAPSHOT"
:description "A free and anonymous hosting for markdown pages." :description "A free and anonymous hosting for markdown pages."
:dependencies [[org.clojure/clojure "1.3.0"] :dependencies [[org.clojure/clojure "1.4.0"]
[cssgen "0.2.6"]
[noir "1.2.1"]] [noir "1.2.1"]]
:main NoteHub.server) :main NoteHub.server)

6
src/NoteHub/views/common.clj

@ -1,12 +1,16 @@
(ns NoteHub.views.common (ns NoteHub.views.common
(:use [noir.core :only [defpartial]] (:use [noir.core :only [defpartial]]
[hiccup.page-helpers :only [include-css html5]])) [hiccup.page-helpers :only [include-css html5]]))
(use 'cssgen)
(defpartial layout [& content] (defpartial layout [& content]
(html5 (html5
[:head [:head
[:title "NoteHub"] [:title "NoteHub"]
(include-css "/css/reset.css")] [:style {:type "text/css"}
(css (rule "h1" :font-family "Impact"))]
]
[:body [:body
; TODO: replace wrapper with smth
[:div#wrapper [:div#wrapper
content]])) content]]))

9
src/NoteHub/views/pages.clj

@ -0,0 +1,9 @@
(ns NoteHub.views.pages
(:require [NoteHub.views.common :as common])
(:use [noir.core :only [defpage]]
[hiccup.core :only [html]]))
(defpage "/" []
(common/layout
[:h1 "Welcome to NoteHub"]))

9
src/NoteHub/views/welcome.clj

@ -1,9 +0,0 @@
(ns NoteHub.views.welcome
(:require [NoteHub.views.common :as common]
[noir.content.getting-started])
(:use [noir.core :only [defpage]]
[hiccup.core :only [html]]))
(defpage "/welcome" []
(common/layout
[:p "Welcome to NoteHub"]))
Loading…
Cancel
Save