summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreltrac <hi@eltr.ac>2026-04-07 16:01:54 +0800
committereltrac <hi@eltr.ac>2026-04-07 16:01:54 +0800
commit0644feeed064479e90fa343ffc0da55720a6e76a (patch)
tree7dc2752bcece639d8f4523fc19c9e7cb2826c62b
parenta8e5d0fcc495ee25797baef512cad3a64d1e2f29 (diff)
chore: use them/venin and make sure build script works
-rw-r--r--build.clj73
-rw-r--r--config/_default/config.toml1
m---------themes/venin0
3 files changed, 17 insertions, 57 deletions
diff --git a/build.clj b/build.clj
index 330caa28..c42ef31e 100644
--- a/build.clj
+++ b/build.clj
@@ -2,28 +2,11 @@
;; Usage: bb build.clj <no_chache?> <rebuild_scripts?>
(require '[babashka.tasks :refer [shell]])
-(require '[babashka.fs :as fs])
;; configuration
-
-(def go-scripts ["extract_highlights"
- "get_external_link_rank"
- "get_internal_link_graph"])
-(def site-path "public/")
-(def feed-path (str site-path "index.xml"))
-
-;; utilities
-
-(defn src-path [s]
- (str "scripts/" s ".go"))
-(defn bin-path [s]
- (str "bin/" s))
-
-(defn pnpm [& args]
- (apply shell "pnpm" args))
+(def theme-path "themes/venin")
;; banner
-
(defn banner []
(println "
▐
@@ -38,57 +21,33 @@
;; build steps
(defn pull-new-changes []
- (shell "git" "pull"))
+ ;; pull from content repository
+ (println "☠︎ Pulling from content repository...")
+ (shell "git" "pull")
+ ;; pull from theme repository
+ (println "☠︎ Pulling from theme repository...")
+ (shell {:dir theme-path} "git" "pull"))
-(defn build-unocss []
- (shell "pnpm" "build:uno:prod"))
-
-(defn build-go-scripts [on-demand]
- (when-not (fs/exists? "bin")
- (fs/create-dir "bin"))
- (cond->> go-scripts
- true (filter #(fs/exists? (src-path %)))
- on-demand (remove #(fs/exists? (bin-path %)))
- true (map (fn [s]
- (println "Building script" s)
- (shell "go" "build" "-o"
- (bin-path s)
- (src-path s))))
- true doall))
-
-(defn run-go-scripts []
- (->> go-scripts
- (map bin-path)
- (filter fs/exists?)
- (map (fn [s]
- (println "Running script" s)
- (shell s)))
- doall))
+(defn build-theme [step]
+ (println (str "☠︎ " step "-building theme..."))
+ (shell {:dir theme-path} "bb" "build.clj" (str step "-build")))
(defn build-site [no-cache?]
+ (println "☠︎ Generating static site...")
(shell "hugo" "--gc" "--minify"
(cond no-cache? "--ignoreCache")))
-(defn index-pagefind-search []
- (pnpm "pagefind" "--site" site-path))
-
-(defn send-webmentions []
- (pnpm "wm" feed-path "--limit" "1" "--send"))
-
;; main process
-(defn before-build-site [rebuild-scripts?]
+(defn before-build-site []
(pull-new-changes)
- (build-unocss)
- (build-go-scripts (not (parse-boolean (or rebuild-scripts? "false"))))
- (run-go-scripts))
+ (build-theme "pre"))
(defn after-build-site []
- (index-pagefind-search)
- (send-webmentions))
+ (build-theme "post"))
-(let [[no-cache? rebuild-scripts?] *command-line-args*]
+(let [[no-cache?] *command-line-args*]
(banner)
- (before-build-site rebuild-scripts?)
+ (before-build-site)
(build-site (parse-boolean (or no-cache? "false")))
(after-build-site))
diff --git a/config/_default/config.toml b/config/_default/config.toml
index 3ba80275..140b02d0 100644
--- a/config/_default/config.toml
+++ b/config/_default/config.toml
@@ -1,3 +1,4 @@
+theme = 'venin'
baseURL = "https://www.geedea.pro/"
timeZone = "Asia/Shanghai"
hasCJKLanguage = true
diff --git a/themes/venin b/themes/venin
-Subproject d733a7aede6421de9f3077b17d7011fadd59824
+Subproject 349c586b85c425d4af0dd0363f4791f903c3c78