master
Josha von Gizycki 6 years ago
parent fec4c12c56
commit 58a900bbe7

@ -14,7 +14,7 @@
(defn env-val [env-name] (defn env-val [env-name]
(let [env-val (System/getenv env-name)] (let [env-val (System/getenv env-name)]
(when (= nil env-val) (when (nil? env-val)
(throw (ex-info (str "env var not found " env-name) (throw (ex-info (str "env var not found " env-name)
{:env-var env-name}))) {:env-var env-name})))
env-val)) env-val))

@ -59,7 +59,7 @@
(page-content "aiaiaiai")) (page-content "aiaiaiai"))
(defn now-str [] (defn now-str []
(.toString (LocalDateTime/now))) (str (LocalDateTime/now)))
(defn file->relpath [file] (defn file->relpath [file]
(let [fullpath (-> file .toPath .toString) (let [fullpath (-> file .toPath .toString)
@ -118,7 +118,8 @@
content (string/replace content #"<p><blink></p>" "") content (string/replace content #"<p><blink></p>" "")
simple (-> html simple (-> html
(string/replace #"&:content" content) (string/replace #"&:content" content)
(string/replace #"&:title" (get-in page [:metadata :title] "")) (string/replace #"&:title"
(get-in page [:metadata :title] ""))
(string/replace #"&:generated-at" (now-str))) (string/replace #"&:generated-at" (now-str)))
particles (particles-in-content simple) particles (particles-in-content simple)
last-blog-sites (last-blog-sites-in-content simple) last-blog-sites (last-blog-sites-in-content simple)

@ -11,10 +11,10 @@
:ftp-user (System/getenv "EQUILIBRIUM_USER") :ftp-user (System/getenv "EQUILIBRIUM_USER")
:ftp-pass (System/getenv "EQUILIBRIUM_PASS")] :ftp-pass (System/getenv "EQUILIBRIUM_PASS")]
(doseq [file (file-seq (io/file "target/page")) (doseq [file (file-seq (io/file "target/page"))
:let [fname (.toString file) :let [fname (str file)
relpath (subs fname (count "target/page")) relpath (subs fname (count "target/page"))
dir? (.isDirectory file)] dir? (.isDirectory file)]
:when (> (count relpath) 0)] :when (pos? (count relpath))]
(let [dest (subs relpath 1)] (let [dest (subs relpath 1)]
(if dir? (if dir?
(do (do

Loading…
Cancel
Save