Sfoglia il codice sorgente

Rename index-posts -> index-content.

Brit Butler 11 anni fa
parent
commit
fb224744e7
2 ha cambiato i file con 9 aggiunte e 9 eliminazioni
  1. 2 2
      plugins/mathjax.lisp
  2. 7 7
      src/indexes.lisp

+ 2 - 2
plugins/mathjax.lisp

@@ -5,7 +5,7 @@
5 5
                           #:content
6 6
                           #:index
7 7
                           #:tag-p
8
-                          #:index-posts))
8
+                          #:index-content))
9 9
 
10 10
 (in-package :coleslaw-mathjax)
11 11
 
@@ -23,6 +23,6 @@
23 23
              (or force
24 24
                  (etypecase obj
25 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 27
     (let ((mathjax-header (format nil *mathjax-header* config location preset)))
28 28
       (add-injection (list mathjax-header #'mathjax-p) :head))))

+ 7 - 7
src/indexes.lisp

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