This repository has been archived by the owner on Apr 14, 2021. It is now read-only.
forked from hashobject/perun
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.boot
57 lines (54 loc) · 2.46 KB
/
build.boot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
(set-env!
:source-paths #{"src"}
:resource-paths #{"resources"}
:dependencies '[[perun "0.4.3-SNAPSHOT" :scope "test"]
[hiccup "1.0.5" :exclusions [org.clojure/clojure]]
[pandeiro/boot-http "0.8.3" :exclusions [org.clojure/clojure]]])
(require '[clojure.string :as str]
'[io.perun :as perun]
'[io.perun.example.index :as index-view]
'[io.perun.example.post :as post-view]
'[pandeiro.boot-http :refer [serve]])
(deftask build
"Build test blog. This task is just for testing different plugins together."
[]
(comp
(perun/global-metadata)
(perun/markdown)
(perun/draft)
(perun/print-meta)
(perun/slug)
(perun/ttr)
(perun/word-count)
(perun/build-date)
(perun/gravatar :source-key :author-email :target-key :author-gravatar)
(perun/render :renderer 'io.perun.example.post/render)
(perun/collection :renderer 'io.perun.example.index/render :page "index.html")
(perun/tags :renderer 'io.perun.example.tags/render)
(perun/paginate :renderer 'io.perun.example.paginate/render)
(perun/assortment :renderer 'io.perun.example.assortment/render
:grouper (fn [entries]
(->> entries
(mapcat (fn [entry]
(if-let [kws (:keywords entry)]
(map #(-> [% entry]) (str/split kws #"\s*,\s*"))
[])))
(reduce (fn [result [kw entry]]
(let [path (str kw ".html")]
(-> result
(update-in [path :entries] conj entry)
(assoc-in [path :entry :keyword] kw))))
{}))))
(perun/static :renderer 'io.perun.example.about/render :page "about.html")
(perun/inject-scripts :scripts #{"start.js"})
(perun/sitemap)
(perun/rss :description "Hashobject blog")
(perun/atom-feed :filterer :original)
(perun/print-meta)
(target)
(notify)))
(deftask dev
[]
(comp (watch)
(build)
(serve :resource-root "public")))