|
@@ -76,41 +76,6 @@
|
76
|
76
|
:prev (when (plusp prev) prev)
|
77
|
77
|
:next (when (<= next (length indexes)) next))))))
|
78
|
78
|
|
79
|
|
-;;; Atom and RSS Feeds
|
80
|
|
-
|
81
|
|
-(defclass feed (index)
|
82
|
|
- ((format :initform nil :initarg :format :accessor feed-format)))
|
83
|
|
-
|
84
|
|
-(defmethod discover ((doc-type (eql (find-class 'feed))))
|
85
|
|
- (let ((content (by-date (find-all 'post))))
|
86
|
|
- (dolist (format '(rss atom))
|
87
|
|
- (let ((feed (make-instance 'feed :format format
|
88
|
|
- :content (take-up-to 10 content)
|
89
|
|
- :slug (format nil "~(~a~)" format))))
|
90
|
|
- (add-document feed)))))
|
91
|
|
-
|
92
|
|
-(defmethod publish ((doc-type (eql (find-class 'feed))))
|
93
|
|
- (dolist (feed (find-all 'feed))
|
94
|
|
- (write-document feed (theme-fn (feed-format feed) "feeds"))))
|
95
|
|
-
|
96
|
|
-;;; Tag Feeds
|
97
|
|
-
|
98
|
|
-(defclass tag-feed (feed) ())
|
99
|
|
-
|
100
|
|
-(defmethod discover ((doc-type (eql (find-class 'tag-feed))))
|
101
|
|
- (let ((content (by-date (find-all 'post))))
|
102
|
|
- (dolist (tag (feeds *config*))
|
103
|
|
- (let ((tagged (remove-if-not (lambda (x) (tag-p tag x)) content)))
|
104
|
|
- (dolist (format '(rss atom))
|
105
|
|
- (let ((feed (make-instance 'tag-feed :format format
|
106
|
|
- :content (take-up-to 10 tagged)
|
107
|
|
- :slug (format nil "~a-~(~a~)" tag format))))
|
108
|
|
- (add-document feed)))))))
|
109
|
|
-
|
110
|
|
-(defmethod publish ((doc-type (eql (find-class 'tag-feed))))
|
111
|
|
- (dolist (feed (find-all 'tag-feed))
|
112
|
|
- (write-document feed (theme-fn (feed-format feed) "feeds"))))
|
113
|
|
-
|
114
|
79
|
;;; Helper Functions
|
115
|
80
|
|
116
|
81
|
(defun all-months ()
|