Skip to content

Commit

Permalink
Allow :nuzzle/title to be function that accepts url and outputs string
Browse files Browse the repository at this point in the history
  • Loading branch information
stelcodes committed Oct 16, 2024
1 parent 8ba6f72 commit 5e417ea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/nuzzle/pages.clj
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,12 @@
all-urls)))
(update-pages [pages]
(reduce-kv
(fn [acc url {:nuzzle/keys [published updated index] :as page}]
(fn [acc url {:nuzzle/keys [title published updated index] :as page}]
(assoc acc url
(cond-> page
true (assoc :nuzzle/url url)
true (update :nuzzle/render-content update-render-content)
(fn? title) (assoc :nuzzle/title (title url))
updated (update :nuzzle/updated #(cond-> %
(= java.util.Date (class %)) (.toInstant)))
published (update :nuzzle/published #(cond-> %
Expand Down

0 comments on commit 5e417ea

Please sign in to comment.