-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.boot
57 lines (52 loc) · 1.61 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 '[[hiccup "1.0.5"]
[perun "0.3.0"]
[hashobject/boot-s3 "0.1.2-SNAPSHOT"]
[clj-time "0.11.0"]
[pandeiro/boot-http "0.7.0"]
[org.martinklepsch/boot-gzip "0.1.2"]])
(require '[io.perun :refer :all]
'[blog.hashobject.views.index :as index-view]
'[blog.hashobject.views.post :as post-view]
'[pandeiro.boot-http :refer [serve]]
'[hashobject.boot-s3 :refer :all]
'[org.martinklepsch.boot-gzip :refer [gzip]])
(task-options!
pom {:project 'blog.hashobject.com
:version "0.2.0"}
s3-sync {
:bucket "blog.hashobject.com"
:access-key (System/getenv "AWS_ACCESS_KEY")
:secret-key (System/getenv "AWS_SECRET_KEY")
:source "public"
:options {"Cache-Control" "max-age=315360000, no-transform, public"}})
(deftask build-dev
"Build blog dev version"
[]
(comp ;(base)
(global-metadata)
(markdown)
(print-meta)
;(draft)
(ttr)
(slug)
(permalink)
(canonical-url)
(render :renderer 'blog.hashobject.views.post/render)
(collection :renderer 'blog.hashobject.views.index/render :page "index.html")))
(deftask build
"Build blog prod version."
[]
(comp (build-dev)
(inject-scripts :scripts #{"ga.js"})
(sitemap :filename "sitemap.xml")
(rss)
(gzip :regex [#".html$" #".css$" #".js$"])
(s3-sync)))
(deftask dev
[]
(comp (watch)
(build-dev)
(serve :resource-root "public")))