2019-10-27 16:20:04 -05:00
|
|
|
(set-env!
|
|
|
|
:source-paths #{"src"}
|
|
|
|
:resource-paths #{"content"}
|
2022-01-01 02:50:09 -06:00
|
|
|
:dependencies '[[perun "0.5.0-SNAPSHOT" :scope "test"]
|
2022-01-01 16:53:58 -06:00
|
|
|
[org.clojure/clojurescript "1.11.4"]
|
|
|
|
[adzerk/boot-cljs "2.1.5" :scope "test"]
|
2022-01-01 02:50:09 -06:00
|
|
|
[hiccup "2.0.0-alpha2" :exclusions [org.clojure/clojure]]
|
2020-05-12 03:24:27 -05:00
|
|
|
[garden "1.3.10"]
|
2020-09-17 23:03:34 -05:00
|
|
|
[org.martinklepsch/boot-garden "1.3.2-0"]
|
2019-10-27 16:20:04 -05:00
|
|
|
[pandeiro/boot-http "0.8.3" :exclusions [org.clojure/clojure]]])
|
|
|
|
|
|
|
|
(require '[io.perun :as perun]
|
2022-01-01 16:53:58 -06:00
|
|
|
'[adzerk.boot-cljs :refer [cljs]]
|
2019-10-27 16:20:04 -05:00
|
|
|
'[pandeiro.boot-http :refer [serve]]
|
2020-09-17 23:03:34 -05:00
|
|
|
'[org.martinklepsch.boot-garden :refer [garden]]
|
2019-10-27 16:20:04 -05:00
|
|
|
'[site.core])
|
|
|
|
|
2022-01-01 16:53:58 -06:00
|
|
|
(deftask build [o optimize? bool "Optimize css & js output"]
|
2020-09-30 23:37:29 -05:00
|
|
|
(comp (perun/draft)
|
|
|
|
(perun/pandoc :cmd-opts ["-f" "markdown" "-t" "html5"])
|
2020-09-17 23:03:34 -05:00
|
|
|
(sift :to-resource #{#"^img/(.*)"})
|
|
|
|
(sift :to-resource #{#"^extra/(.*)"})
|
2021-03-20 15:47:30 -05:00
|
|
|
(sift :to-resource #{#"^CNAME"})
|
2022-01-01 16:53:58 -06:00
|
|
|
(garden :styles-var 'site.styles/base :output-to "main.css" :pretty-print (if optimize? false true))
|
|
|
|
(cljs :optimizations (if optimize? :advanced :none) :source-map (if optimize? false true))
|
2020-09-30 23:37:29 -05:00
|
|
|
(perun/ttr) ;; Time to read
|
|
|
|
(perun/word-count)
|
2019-10-27 16:20:04 -05:00
|
|
|
(perun/render :renderer 'site.core/page)
|
2020-09-30 23:37:29 -05:00
|
|
|
(perun/permalink :filterer (fn [p] (not= (:slug p) "index")))
|
|
|
|
(perun/collection :renderer 'site.core/page-blog
|
|
|
|
:filterer (fn [p] (:title p)) ; don't list anything without a title
|
|
|
|
:sortby :date
|
|
|
|
:page "blog/index.html" :out-dir "")
|
2020-09-17 23:03:34 -05:00
|
|
|
(perun/sitemap :filename "sitemap.xml")
|
2020-09-30 23:37:29 -05:00
|
|
|
(sift :move {#"^public/(.*)" "$1"}))) ; perun/render ignores out-dir for some reason
|
2022-01-01 16:53:58 -06:00
|
|
|
|
2020-09-30 23:37:29 -05:00
|
|
|
|
2019-10-27 16:20:04 -05:00
|
|
|
|
2020-09-17 23:03:34 -05:00
|
|
|
(deftask dev []
|
|
|
|
(comp (watch)
|
2022-01-01 16:53:58 -06:00
|
|
|
(build :optimize? false)
|
2020-09-18 01:29:45 -05:00
|
|
|
(serve :port 8000 :resource-root "")))
|
2019-10-27 16:20:04 -05:00
|
|
|
|
2020-09-17 23:03:34 -05:00
|
|
|
(deftask publish []
|
2022-01-01 16:53:58 -06:00
|
|
|
(comp (build :optimize? true)
|
2020-09-17 23:03:34 -05:00
|
|
|
(target :dir #{"docs"})))
|