Add CSS generation
This commit is contained in:
parent
32f40736ff
commit
0eda7a2685
|
@ -2,10 +2,13 @@
|
||||||
:source-paths #{"src"}
|
:source-paths #{"src"}
|
||||||
:resource-paths #{"content"}
|
:resource-paths #{"content"}
|
||||||
:dependencies '[[perun "0.4.3-SNAPSHOT" :scope "test"]
|
:dependencies '[[perun "0.4.3-SNAPSHOT" :scope "test"]
|
||||||
|
[deraen/boot-livereload "0.2.1" :scope "test"]
|
||||||
[hiccup "1.0.5" :exclusions [org.clojure/clojure]]
|
[hiccup "1.0.5" :exclusions [org.clojure/clojure]]
|
||||||
|
[garden "1.3.10"]
|
||||||
[pandeiro/boot-http "0.8.3" :exclusions [org.clojure/clojure]]])
|
[pandeiro/boot-http "0.8.3" :exclusions [org.clojure/clojure]]])
|
||||||
|
|
||||||
(require '[io.perun :as perun]
|
(require '[io.perun :as perun]
|
||||||
|
'[deraen.boot-livereload :refer [livereload]]
|
||||||
'[pandeiro.boot-http :refer [serve]]
|
'[pandeiro.boot-http :refer [serve]]
|
||||||
'[site.core])
|
'[site.core])
|
||||||
|
|
||||||
|
@ -15,8 +18,10 @@
|
||||||
(perun/sitemap :filename "sitemap.xml")))
|
(perun/sitemap :filename "sitemap.xml")))
|
||||||
|
|
||||||
(deftask serve-website []
|
(deftask serve-website []
|
||||||
(comp (build-website)
|
(comp (livereload)
|
||||||
|
(build-website)
|
||||||
(serve :port 8000 :resource-root "public")
|
(serve :port 8000 :resource-root "public")
|
||||||
|
; (repl)
|
||||||
(wait)))
|
(wait)))
|
||||||
|
|
||||||
(deftask compile-website []
|
(deftask compile-website []
|
||||||
|
|
|
@ -1,7 +1,18 @@
|
||||||
(ns site.core
|
(ns site.core
|
||||||
(:require [hiccup.page :as hp]))
|
(:require [hiccup.page :as hp]
|
||||||
|
[garden.core :as gc]))
|
||||||
|
|
||||||
|
(def textcolor-main "rgba(0, 0, 0, 0.87)")
|
||||||
|
|
||||||
|
(def css
|
||||||
|
(gc/css
|
||||||
|
[:body
|
||||||
|
{:max-width "600px"
|
||||||
|
:color textcolor-main}]
|
||||||
|
))
|
||||||
|
|
||||||
(defn page [data]
|
(defn page [data]
|
||||||
(hp/html5
|
(hp/html5
|
||||||
[:div {:style "max-width: 600px;"}
|
[:head [:style css]]
|
||||||
|
[:div
|
||||||
(-> data :entry :content)]))
|
(-> data :entry :content)]))
|
||||||
|
|
Loading…
Reference in a new issue