From c2ff1badf847a1ac508373c52102a7981e6a14ff Mon Sep 17 00:00:00 2001 From: Javier Olaechea Date: Tue, 25 Oct 2016 17:44:41 -0500 Subject: [PATCH] ALL-MONTHS: Don't assume that content has a date --- src/indexes.lisp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/indexes.lisp b/src/indexes.lisp index 6cbf056..3c30763 100644 --- a/src/indexes.lisp +++ b/src/indexes.lisp @@ -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 ()