Skip to content

Commit d00e14b

Browse files
committed
v0.3.6
1 parent ebf91f5 commit d00e14b

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ Instances of quickblog can be seen here:
1515
- [Henry Widd's blog](https://widdindustries.com/blog)
1616
- [Anders means different](https://www.eknert.com/blog) - ([source](https://github.com/anderseknert/blog))
1717

18+
## 0.3.6 (2031-12-31)
19+
20+
- Fix caching (this is hard)
21+
1822
## 0.3.5 (2023-12-31)
1923

2024
- Better caching when switching between watch and render

src/quickblog/api.clj

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,14 @@
188188
:favicon-out-dir (out-dir-ify favicon-out-dir))))
189189

190190
(defn update-cache-dir [opts]
191-
(let [cache-dir (:cache-dir opts)
192-
cache-dir (when cache-dir
193-
(if (:watch opts)
194-
(str (fs/file cache-dir "dev"))
195-
(str (fs/file cache-dir "prod"))))]
196-
(assoc opts :cache-dir cache-dir)))
191+
(if (:cache-dir-final opts)
192+
opts
193+
(let [cache-dir (:cache-dir opts)
194+
cache-dir (when cache-dir
195+
(if (:watch opts)
196+
(str (fs/file cache-dir "dev"))
197+
(str (fs/file cache-dir "prod"))))]
198+
(assoc opts :cache-dir cache-dir :cache-dir-final true))))
197199

198200
(defn- update-opts [opts]
199201
(-> opts
@@ -612,9 +614,9 @@
612614
(let [{:keys [assets-dir assets-out-dir posts-dir templates-dir]
613615
:as opts}
614616
(-> opts
615-
apply-default-opts
616617
(assoc :watch (format "<script type=\"text/javascript\" src=\"%s\"></script>"
617618
lib/live-reload-script))
619+
apply-default-opts
618620
render)]
619621
(reset! posts-cache (:posts opts))
620622
(serve opts false)

0 commit comments

Comments
 (0)