|
@@ -17,9 +17,6 @@
|
17
|
17
|
|
18
|
18
|
(defclass tag-index (index) ())
|
19
|
19
|
|
20
|
|
-(defmethod page-url ((object tag-index))
|
21
|
|
- (format nil "tag/~a" (index-slug object)))
|
22
|
|
-
|
23
|
20
|
(defmethod discover ((doc-type (eql (find-class 'tag-index))))
|
24
|
21
|
(let ((content (by-date (find-all 'post))))
|
25
|
22
|
(dolist (tag (all-tags))
|
|
@@ -39,9 +36,6 @@
|
39
|
36
|
|
40
|
37
|
(defclass month-index (index) ())
|
41
|
38
|
|
42
|
|
-(defmethod page-url ((object month-index))
|
43
|
|
- (format nil "date/~a" (index-slug object)))
|
44
|
|
-
|
45
|
39
|
(defmethod discover ((doc-type (eql (find-class 'month-index))))
|
46
|
40
|
(let ((content (by-date (find-all 'post))))
|
47
|
41
|
(dolist (month (all-months))
|
|
@@ -61,9 +55,6 @@
|
61
|
55
|
|
62
|
56
|
(defclass numeric-index (index) ())
|
63
|
57
|
|
64
|
|
-(defmethod page-url ((object numeric-index))
|
65
|
|
- (format nil "~d" (index-slug object)))
|
66
|
|
-
|
67
|
58
|
(defmethod discover ((doc-type (eql (find-class 'numeric-index))))
|
68
|
59
|
(let ((content (by-date (find-all 'post))))
|
69
|
60
|
(dotimes (i (ceiling (length content) 10))
|
|
@@ -90,13 +81,12 @@
|
90
|
81
|
(defclass feed (index)
|
91
|
82
|
((format :initform nil :initarg :format :accessor feed-format)))
|
92
|
83
|
|
93
|
|
-(defmethod page-url ((object feed))
|
94
|
|
- (format nil "~(~a~).xml" (feed-format object)))
|
95
|
|
-
|
96
|
84
|
(defmethod discover ((doc-type (eql (find-class 'feed))))
|
97
|
|
- (let ((content (take-up-to 10 (by-date (find-all 'post)))))
|
|
85
|
+ (let ((content (by-date (find-all 'post))))
|
98
|
86
|
(dolist (format '(rss atom))
|
99
|
|
- (let ((feed (make-instance 'feed :content content :format format)))
|
|
87
|
+ (let ((feed (make-instance 'feed :format format
|
|
88
|
+ :content (take-up-to 10 content)
|
|
89
|
+ :slug (format nil "~(~a~)" format))))
|
100
|
90
|
(add-document feed)))))
|
101
|
91
|
|
102
|
92
|
(defmethod publish ((doc-type (eql (find-class 'feed))))
|
|
@@ -107,17 +97,14 @@
|
107
|
97
|
|
108
|
98
|
(defclass tag-feed (feed) ())
|
109
|
99
|
|
110
|
|
-(defmethod page-url ((object tag-feed))
|
111
|
|
- (format nil "tag/~a~(~a~).xml" (index-slug object) (feed-format object)))
|
112
|
|
-
|
113
|
100
|
(defmethod discover ((doc-type (eql (find-class 'tag-feed))))
|
114
|
101
|
(let ((content (by-date (find-all 'post))))
|
115
|
102
|
(dolist (tag (feeds *config*))
|
116
|
103
|
(let ((tagged (remove-if-not (lambda (x) (tag-p tag x)) content)))
|
117
|
104
|
(dolist (format '(rss atom))
|
118
|
|
- (let ((feed (make-instance 'tag-feed :content (take-up-to 10 tagged)
|
119
|
|
- :format format
|
120
|
|
- :slug tag)))
|
|
105
|
+ (let ((feed (make-instance 'tag-feed :format format
|
|
106
|
+ :content (take-up-to 10 tagged)
|
|
107
|
+ :slug (format nil "~a-~(~a~)" tag format))))
|
121
|
108
|
(add-document feed)))))))
|
122
|
109
|
|
123
|
110
|
(defmethod publish ((doc-type (eql (find-class 'tag-feed))))
|