Merge pull request #122 from PuercoPop/ignore-missing-date

Close #121: ALL-MONTHS: Don't assume that content has a date
This commit is contained in:
Javier Olaechea 2016-10-26 20:35:48 -05:00 committed by GitHub
commit 2ee2609020

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 ()