diff --git a/CHANGELOG.md b/CHANGELOG.md index ec023cc..841414b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,10 @@ Instances of quickblog can be seen here: - [Henry Widd's blog](https://widdindustries.com/blog) - [Anders means different](https://www.eknert.com/blog) - ([source](https://github.com/anderseknert/blog)) +## 0.3.6 (2031-12-31) + +- Fix caching (this is hard) + ## 0.3.5 (2023-12-31) - Better caching when switching between watch and render diff --git a/src/quickblog/api.clj b/src/quickblog/api.clj index 014b9e8..6556e6a 100644 --- a/src/quickblog/api.clj +++ b/src/quickblog/api.clj @@ -188,12 +188,14 @@ :favicon-out-dir (out-dir-ify favicon-out-dir)))) (defn update-cache-dir [opts] - (let [cache-dir (:cache-dir opts) - cache-dir (when cache-dir - (if (:watch opts) - (str (fs/file cache-dir "dev")) - (str (fs/file cache-dir "prod"))))] - (assoc opts :cache-dir cache-dir))) + (if (:cache-dir-final opts) + opts + (let [cache-dir (:cache-dir opts) + cache-dir (when cache-dir + (if (:watch opts) + (str (fs/file cache-dir "dev")) + (str (fs/file cache-dir "prod"))))] + (assoc opts :cache-dir cache-dir :cache-dir-final true)))) (defn- update-opts [opts] (-> opts @@ -612,9 +614,9 @@ (let [{:keys [assets-dir assets-out-dir posts-dir templates-dir] :as opts} (-> opts - apply-default-opts (assoc :watch (format "" lib/live-reload-script)) + apply-default-opts render)] (reset! posts-cache (:posts opts)) (serve opts false)