|
@@ -16,15 +16,13 @@
|
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)))
|
19
|
21
|
|
20
|
|
-(defmethod page-path ((object index))
|
21
|
|
- (rel-path (staging-dir *config*) (index-id object)))
|
22
|
|
-(defmethod page-path ((object tag-index))
|
23
|
|
- (rel-path (staging-dir *config*) "tag/~a" (index-id object)))
|
24
|
|
-(defmethod page-path ((object date-index))
|
25
|
|
- (rel-path (staging-dir *config*) "date/~a" (index-id object)))
|
26
|
|
-(defmethod page-path ((object int-index))
|
27
|
|
- (rel-path (staging-dir *config*) "~d" (index-id object)))
|
|
22
|
+(defmethod page-url ((object index))
|
|
23
|
+ (index-id object))
|
|
24
|
+(defmethod page-url ((object date-index))
|
|
25
|
+ (format nil "date/~a" (index-id object)))
|
28
|
26
|
|
29
|
27
|
(defun all-months ()
|
30
|
28
|
"Retrieve a list of all months with published content."
|
|
@@ -40,7 +38,7 @@
|
40
|
38
|
|
41
|
39
|
(defun index-by-tag (tag content)
|
42
|
40
|
"Return an index of all CONTENT matching the given TAG."
|
43
|
|
- (make-instance 'tag-index :id (tag-slug tag)
|
|
41
|
+ (make-instance 'tag-index :id (page-url tag)
|
44
|
42
|
:posts (remove-if-not (lambda (x) (tag-p tag x)) content)
|
45
|
43
|
:title (format nil "Posts tagged ~a" (tag-name tag))))
|
46
|
44
|
|
|
@@ -54,7 +52,7 @@
|
54
|
52
|
"Return the index for the Ith page of CONTENT in reverse chronological order."
|
55
|
53
|
(let* ((start (* step i))
|
56
|
54
|
(end (min (length content) (+ start step))))
|
57
|
|
- (make-instance 'int-index :id (1+ i)
|
|
55
|
+ (make-instance 'int-index :id (format nil "~d" (1+ i))
|
58
|
56
|
:posts (subseq content start end)
|
59
|
57
|
:title "Recent Posts")))
|
60
|
58
|
|