diff --git a/src/equilibrium/core.clj b/src/equilibrium/core.clj index d6fff8e..6c0c99d 100644 --- a/src/equilibrium/core.clj +++ b/src/equilibrium/core.clj @@ -14,7 +14,7 @@ (defn env-val [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) {:env-var env-name}))) env-val)) diff --git a/src/equilibrium/render.clj b/src/equilibrium/render.clj index 8ca2ab1..0f4266a 100644 --- a/src/equilibrium/render.clj +++ b/src/equilibrium/render.clj @@ -59,7 +59,7 @@ (page-content "aiaiaiai")) (defn now-str [] - (.toString (LocalDateTime/now))) + (str (LocalDateTime/now))) (defn file->relpath [file] (let [fullpath (-> file .toPath .toString) @@ -118,7 +118,8 @@ content (string/replace content #"
" "") simple (-> html (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))) particles (particles-in-content simple) last-blog-sites (last-blog-sites-in-content simple) diff --git a/src/leiningen/equilibrium.clj b/src/leiningen/equilibrium.clj index a50b9ee..d222f05 100644 --- a/src/leiningen/equilibrium.clj +++ b/src/leiningen/equilibrium.clj @@ -11,10 +11,10 @@ :ftp-user (System/getenv "EQUILIBRIUM_USER") :ftp-pass (System/getenv "EQUILIBRIUM_PASS")] (doseq [file (file-seq (io/file "target/page")) - :let [fname (.toString file) + :let [fname (str file) relpath (subs fname (count "target/page")) dir? (.isDirectory file)] - :when (> (count relpath) 0)] + :when (pos? (count relpath))] (let [dest (subs relpath 1)] (if dir? (do