update list-posts-archive to make the results easier to work with in a clabango template

This commit is contained in:
Gered 2013-05-26 18:44:05 -04:00
parent d9178c25a0
commit 475f3e397d

View file

@ -96,10 +96,14 @@
(if-let [posts (->post-list
(couch/with-db posts
(couch/get-view "posts" view-name {:descending true})))]
(group-by
(fn [p]
(->nicer-month-year-str (:mmyyyy p)))
posts))))
(vals
(group-by
(fn [p]
(:mmyyyy p))
(map
(fn [p]
(assoc p :mmyyyy (->nicer-month-year-str (:mmyyyy p))))
posts))))))
(defn count-posts
[unpublished?]