-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbb.edn
68 lines (56 loc) · 2.88 KB
/
bb.edn
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
58
59
60
61
62
63
64
65
66
67
68
{:pods {clj-kondo/clj-kondo {:version "2024.03.05"}
org.babashka/fswatcher {:version "0.0.5"}}
:deps {io.github.borkdude/quickblog {:git/sha "caffe692c8d715b30c8851ab8210dbabb19a1785"}
org.babashka/cli {:mvn/version "0.3.31"}
lread/status-line {:git/url "https://github.com/lread/status-line.git"
:sha "cf44c15f30ea3867227fa61ceb823e5e942c707f"}}
:paths ["." "src"]
:tasks
{:requires ([clojure.string :as string]
[babashka.fs :as fs]
[quickblog.api :as r]
[babashka.cli :as cli]
[lread.status-line :as status]
[dotcom.core :as dotcom])
:init (def opts
(merge (cli/parse-opts *command-line-args*)
{:blog-author "Berkeley Martinez"
:blog-title "Berkeley True"
:blog-description "Doing tech, one line of code at a time."
:out-dir "out"
:blog-root "https://berkeleytrue.com/"
:discuss-link "https://github.com/berkeleytrue/dotcom/discussions/categories/posts"
:about-link "https://berkeleytrue.com/about"
:favicon false
:posts-dir "data"
:assets-dir "public"
:port 3000
:favicon-dir "public/favicon"}))
:enter (let [{:keys [name]} (current-task)] (status/line :head ">==<TASK %s>==> %s" name (string/join " " *command-line-args*)))
:leave (let [{:keys [name]} (current-task)] (status/line :detail "\n>==<TASK %s>==> done." name))
new {:doc "Create new blog article"
:task (r/new opts)}
render {:doc "Render blog"
:task (r/quickblog opts)}
render-resume {:doc "Render resume"
:task (dotcom/spit-resume opts)}
clean {:doc "Remove .work and out directory"
:task (do (fs/delete-tree ".work")
(fs/delete-tree "out"))}
css {:doc "Compile Tailwind CSS to out/style.css"
:task (shell "tailwindcss -i templates/style.css -o out/style.css")}
dev:css {:doc "Watch Tailwind CSS and compile to out/style.css"
:task (shell "tailwindcss -i templates/style.css -o out/style.css --watch")}
dev:templates {:doc "Watch posts and templates and call render on file changes, starts file server"
:task (r/watch opts)}
dev:resume {:doc "Watches resume and renders on change"
:task (dotcom/watch-resume opts)}
-dev {:depends [dev:templates dev:css dev:resume]}
dev {:doc "Start development server with file watching and live reload."
:depends [clean render render-resume css]
:task (run '-dev {:parallel true})}
build {:doc "Build blog"
:depends [clean render css render-resume]}
quickblog {:doc "Start blogging quickly! Run `bb quickblog help` for details."
:requires ([quickblog.cli :as qcli])
:task (qcli/dispatch opts)}}}