|
@@ -16,17 +16,15 @@
|
16
|
16
|
(defclass tag-index (index) ())
|
17
|
17
|
(defclass date-index (index) ())
|
18
|
18
|
(defclass int-index (index) ())
|
19
|
|
-(defclass url-index (index)
|
20
|
|
- ((urls :initform nil :initarg :urls :accessor urls)
|
21
|
|
- (pubdate :initform (local-time:format-rfc3339-timestring nil
|
22
|
|
- (local-time:now))
|
23
|
|
- :initarg :pubdate
|
24
|
|
- :accessor index-pubdate)))
|
25
|
19
|
|
26
|
20
|
(defmethod page-url ((object index))
|
27
|
21
|
(index-id object))
|
|
22
|
+(defmethod page-url ((object tag-index))
|
|
23
|
+ (format nil "tags/~a" (index-id object)))
|
28
|
24
|
(defmethod page-url ((object date-index))
|
29
|
25
|
(format nil "date/~a" (index-id object)))
|
|
26
|
+(defmethod page-url ((object int-index))
|
|
27
|
+ (format nil "~d" (index-id object)))
|
30
|
28
|
|
31
|
29
|
(defun all-months ()
|
32
|
30
|
"Retrieve a list of all months with published content."
|
|
@@ -42,7 +40,7 @@
|
42
|
40
|
|
43
|
41
|
(defun index-by-tag (tag content)
|
44
|
42
|
"Return an index of all CONTENT matching the given TAG."
|
45
|
|
- (make-instance 'tag-index :id (page-url tag)
|
|
43
|
+ (make-instance 'tag-index :id (tag-slug tag)
|
46
|
44
|
:posts (remove-if-not (lambda (x) (tag-p tag x)) content)
|
47
|
45
|
:title (format nil "Posts tagged ~a" (tag-name tag))))
|
48
|
46
|
|
|
@@ -56,7 +54,7 @@
|
56
|
54
|
"Return the index for the Ith page of CONTENT in reverse chronological order."
|
57
|
55
|
(let* ((start (* step i))
|
58
|
56
|
(end (min (length content) (+ start step))))
|
59
|
|
- (make-instance 'int-index :id (format nil "~d" (1+ i))
|
|
57
|
+ (make-instance 'int-index :id (1+ i)
|
60
|
58
|
:posts (subseq content start end)
|
61
|
59
|
:title "Recent Posts")))
|
62
|
60
|
|