ALL-MONTHS: Don't assume that content has a date

This commit is contained in:
Javier Olaechea 2016-10-25 17:44:41 -05:00
parent 7f69c93b6a
commit c2ff1badf8

View file

@ -92,8 +92,10 @@ of content loaded in the DB."
(defun all-months ()
"Retrieve a list of all months with published content."
(let ((months (mapcar (lambda (x) (subseq (content-date x) 0 7))
(find-all 'post))))
(let ((months (loop :for post :in (find-all 'post)
:for content-date := (content-date post)
:when content-date
:collect content-date)))
(sort (remove-duplicates months :test #'string=) #'string>)))
(defun all-tags ()