Browse Source

Rename index-posts -> index-content.

Brit Butler 11 years ago
parent
commit
fb224744e7
2 changed files with 9 additions and 9 deletions
  1. 2 2
      plugins/mathjax.lisp
  2. 7 7
      src/indexes.lisp

+ 2 - 2
plugins/mathjax.lisp

5
                           #:content
5
                           #:content
6
                           #:index
6
                           #:index
7
                           #:tag-p
7
                           #:tag-p
8
-                          #:index-posts))
8
+                          #:index-content))
9
 
9
 
10
 (in-package :coleslaw-mathjax)
10
 (in-package :coleslaw-mathjax)
11
 
11
 
23
              (or force
23
              (or force
24
                  (etypecase obj
24
                  (etypecase obj
25
                    (content (math-post-p obj))
25
                    (content (math-post-p obj))
26
-                   (index (some #'math-post-p (index-posts obj)))))))
26
+                   (index (some #'math-post-p (index-content obj)))))))
27
     (let ((mathjax-header (format nil *mathjax-header* config location preset)))
27
     (let ((mathjax-header (format nil *mathjax-header* config location preset)))
28
       (add-injection (list mathjax-header #'mathjax-p) :head))))
28
       (add-injection (list mathjax-header #'mathjax-p) :head))))

+ 7 - 7
src/indexes.lisp

2
 
2
 
3
 (defclass index ()
3
 (defclass index ()
4
   ((slug :initform nil :initarg :slug :accessor index-slug)
4
   ((slug :initform nil :initarg :slug :accessor index-slug)
5
-   (posts :initform nil :initarg :posts :accessor index-posts)
6
-   (title :initform nil :initarg :title :accessor index-title)))
5
+   (title :initform nil :initarg :title :accessor index-title)
6
+   (content :initform nil :initarg :content :accessor index-content)))
7
 
7
 
8
 (defmethod render ((object index) &key prev next)
8
 (defmethod render ((object index) &key prev next)
9
   (funcall (theme-fn 'index) (list :tags (all-tags)
9
   (funcall (theme-fn 'index) (list :tags (all-tags)
29
 (defun index-by-tag (tag content)
29
 (defun index-by-tag (tag content)
30
   "Return an index of all CONTENT matching the given TAG."
30
   "Return an index of all CONTENT matching the given TAG."
31
   (make-instance 'tag-index :slug (tag-slug tag)
31
   (make-instance 'tag-index :slug (tag-slug tag)
32
-                 :posts (remove-if-not (lambda (x) (tag-p tag x)) content)
32
+                 :content (remove-if-not (lambda (x) (tag-p tag x)) content)
33
                  :title (format nil "Posts tagged ~a" (tag-name tag))))
33
                  :title (format nil "Posts tagged ~a" (tag-name tag))))
34
 
34
 
35
 (defmethod publish ((doc-type (eql (find-class 'tag-index))))
35
 (defmethod publish ((doc-type (eql (find-class 'tag-index))))
52
 (defun index-by-month (month content)
52
 (defun index-by-month (month content)
53
   "Return an index of all CONTENT matching the given MONTH."
53
   "Return an index of all CONTENT matching the given MONTH."
54
   (make-instance 'month-index :slug month
54
   (make-instance 'month-index :slug month
55
-                 :posts (remove-if-not (lambda (x) (month-p month x)) content)
55
+                 :content (remove-if-not (lambda (x) (month-p month x)) content)
56
                  :title (format nil "Posts from ~a" month)))
56
                  :title (format nil "Posts from ~a" month)))
57
 
57
 
58
 (defmethod publish ((doc-type (eql (find-class 'month-index))))
58
 (defmethod publish ((doc-type (eql (find-class 'month-index))))
76
   "Return the index for the Ith page of CONTENT in reverse chronological order."
76
   "Return the index for the Ith page of CONTENT in reverse chronological order."
77
   (let ((content (subseq content (* 10 i))))
77
   (let ((content (subseq content (* 10 i))))
78
     (make-instance 'numeric-index :slug (1+ i)
78
     (make-instance 'numeric-index :slug (1+ i)
79
-                   :posts (take-up-to 10 content)
79
+                   :content (take-up-to 10 content)
80
                    :title "Recent Posts")))
80
                    :title "Recent Posts")))
81
 
81
 
82
 (defmethod publish ((doc-type (eql (find-class 'numeric-index))))
82
 (defmethod publish ((doc-type (eql (find-class 'numeric-index))))
98
 (defmethod discover ((doc-type (eql (find-class 'feed))))
98
 (defmethod discover ((doc-type (eql (find-class 'feed))))
99
   (let ((content (take-up-to 10 (by-date (find-all 'post)))))
99
   (let ((content (take-up-to 10 (by-date (find-all 'post)))))
100
     (dolist (format '(rss atom))
100
     (dolist (format '(rss atom))
101
-      (let ((feed (make-instance 'feed :posts content :format format)))
101
+      (let ((feed (make-instance 'feed :content content :format format)))
102
         (add-document feed)))))
102
         (add-document feed)))))
103
 
103
 
104
 (defmethod publish ((doc-type (eql (find-class 'feed))))
104
 (defmethod publish ((doc-type (eql (find-class 'feed))))
115
     (dolist (tag (feeds *config*))
115
     (dolist (tag (feeds *config*))
116
       (let ((posts (remove-if-not (lambda (x) (tag-p tag x)) content)))
116
       (let ((posts (remove-if-not (lambda (x) (tag-p tag x)) content)))
117
         (dolist (format '(rss atom))
117
         (dolist (format '(rss atom))
118
-          (let ((feed (make-instance 'tag-feed :posts (take-up-to 10 posts)
118
+          (let ((feed (make-instance 'tag-feed :content (take-up-to 10 posts)
119
                                      :format format
119
                                      :format format
120
                                      :slug tag)))
120
                                      :slug tag)))
121
             (add-document feed)))))))
121
             (add-document feed)))))))