borkdude / quickblog

Light-weight static blog engine for Clojure and babashka
https://blog.michielborkent.nl/
MIT License
165 stars 28 forks source link

Replace workaround that copies metadata from `api/serve` #58

Closed ljpengelen closed 1 year ago

ljpengelen commented 1 year ago

https://github.com/borkdude/quickblog/blob/main/src/quickblog/cli.clj contains the following comment:

;; api/serve returns immediately, so we'll wait on a promise
;; after calling it to prevent the process from exiting. In
;; order for the help text to work, we need to grab the metadata
;; from the api/serve var and attach it to our fn. This is
;; admittedly gross and I should be scolded severely for this
;; nonsense. Send a pull request along the scolding, if you
;; don't mind!

https://github.com/borkdude/quickblog/pull/57 proposes an alternative implementation of serve that doesn't require the copying of metadata from serve to the nameless function that blocks.