Brit Butler преди 12 години
родител
ревизия
3d1301dc6d
променени са 3 файла, в които са добавени 7 реда и са изтрити 7 реда
  1. 1 1
      src/feeds.lisp
  2. 3 3
      src/indices.lisp
  3. 3 3
      src/posts.lisp

+ 1 - 1
src/feeds.lisp

@@ -11,7 +11,7 @@
11 11
   "Render and write the given FEEDS for the site."
12 12
   (flet ((first-10 (list)
13 13
            (subseq list 0 (min (length list) 10))))
14
-    (let* ((by-date (by-date (hash-table-values *posts*)))
14
+    (let* ((by-date (by-date (find-all 'post)))
15 15
            (posts (first-10 by-date))
16 16
            (rss (make-instance 'index :id "rss.xml" :posts posts))
17 17
            (atom (make-instance 'index :id "feed.atom" :posts posts)))

+ 3 - 3
src/indices.lisp

@@ -28,7 +28,7 @@
28 28
 
29 29
 (defun all-months ()
30 30
   "Retrieve a list of all months with published posts."
31
-  (sort (remove-duplicates (mapcar (lambda (x) (get-month (post-date x)))
31
+  (sort (remove-duplicates (mapcar (lambda (x) (get-month (content-date x)))
32 32
                                    (hash-table-values *content*)) :test #'string=)
33 33
         #'string>))
34 34
 
@@ -51,7 +51,7 @@
51 51
 
52 52
 (defun index-by-month (month posts)
53 53
   "Return an index of all POSTS matching the given MONTH."
54
-  (let ((content (remove-if-not (lambda (post) (search month (post-date post)))
54
+  (let ((content (remove-if-not (lambda (post) (search month (content-date post)))
55 55
                                 posts)))
56 56
     (make-instance 'date-index :id month
57 57
                                :posts content
@@ -67,7 +67,7 @@
67 67
 
68 68
 (defun render-indices ()
69 69
   "Render the indices to view posts in groups of size N, by month, and by tag."
70
-  (let ((posts (by-date (hash-table-values *content*))))
70
+  (let ((posts (by-date (find-all 'post))))
71 71
     (dolist (tag (all-tags))
72 72
       (let ((index (index-by-tag tag posts)))
73 73
         (write-page (page-path index) (render-page index))))

+ 3 - 3
src/posts.lisp

@@ -14,11 +14,11 @@
14 14
 (defmethod page-path ((object post))
15 15
   (rel-path (staging *config*) "posts/~a" (content-slug object)))
16 16
 
17
-(defmethod initialize-instance :after ((post post) &key)
17
+(defmethod initialize-instance :after ((object post) &key)
18 18
   (with-accessors ((title post-title)
19 19
                    (format post-format)
20
-                   (content post-content)) post
21
-      (setf (content-slug post) (slugify title)
20
+                   (content post-content)) object
21
+      (setf (content-slug object) (slugify title)
22 22
             format (make-keyword (string-upcase format))
23 23
             content (render-content content format))))
24 24