|
@@ -23,7 +23,6 @@
|
23
|
23
|
(defclass tag-index (index) ())
|
24
|
24
|
|
25
|
25
|
(defmethod discover ((doc-type (eql (find-class 'tag-index))))
|
26
|
|
- (setf *all-tags* (all-tags))
|
27
|
26
|
(let ((content (by-date (find-all 'post))))
|
28
|
27
|
(dolist (tag (all-tags))
|
29
|
28
|
(add-document (index-by-tag tag content)))))
|
|
@@ -43,7 +42,6 @@
|
43
|
42
|
(defclass month-index (index) ())
|
44
|
43
|
|
45
|
44
|
(defmethod discover ((doc-type (eql (find-class 'month-index))))
|
46
|
|
- (setf *all-months* (all-months))
|
47
|
45
|
(let ((content (by-date (find-all 'post))))
|
48
|
46
|
(dolist (month *all-months*)
|
49
|
47
|
(add-document (index-by-month month content)))))
|
|
@@ -85,6 +83,12 @@
|
85
|
83
|
|
86
|
84
|
;;; Helper Functions
|
87
|
85
|
|
|
86
|
+(defun update-content-metadata ()
|
|
87
|
+ "Set *ALL-TAGS* and *ALL-MONTHS* to the union of all tags and months
|
|
88
|
+of content loaded in the DB."
|
|
89
|
+ (setf *all-tags* (all-tags))
|
|
90
|
+ (setf *all-months* (all-months)))
|
|
91
|
+
|
88
|
92
|
(defun all-months ()
|
89
|
93
|
"Retrieve a list of all months with published content."
|
90
|
94
|
(let ((months (mapcar (lambda (x) (subseq (content-date x) 0 7))
|