commit 6f29842913fb722f8b12e1361a018679874d6d0e from: Omar Polo date: Sun Sep 20 21:40:45 2020 UTC rework a bit the subtitle line the `by` field of `music` is optional, and while there simplify the code. Use only a single final "." both for when there is a music and when there's not commit - 6776a2f29953bb35589f42d2831428ae6d45a46f commit + 6f29842913fb722f8b12e1361a018679874d6d0e blob - 324c457997995772f3354bcb90a1cf7cd9755a32 blob + 0bc6f132724c391a9d57356953ef508faedcefa1 --- src/blog/templates.clj +++ src/blog/templates.clj @@ -55,12 +55,15 @@ [:a {:href (str "/post/" slug ".html")} title] title)] [:p.author "Written by " [:em "Omar Polo"] " on " (time/fmt-loc date) - (if music - (list " while listening to " [:a {:href (:url music) - :target "_blank" - :rel "noopener"} - "“" [:em (:title music)] "”" " by " [:em (:by music)]] ".") - ".")] + (list + (when music + (list " while listening to " [:a {:href (:url music) + :target "_blank" + :rel "noopener"} + "“" [:em (:title music)] "”" + (when-let [by (:by music)] + (list " by " [:em by]))])) + ".")] [:ul.tags (map #(vector :li [:a {:href (str "/tag/" (name %) ".html")} (str "#" (name %))]) tags)]