From 3d1301dc6d857db9c7a44b358c3c0a1b8db614a1 Mon Sep 17 00:00:00 2001 From: Brit Butler Date: Tue, 1 Jan 2013 19:41:15 -0500 Subject: [PATCH] Fix feeds and indices. --- src/feeds.lisp | 2 +- src/indices.lisp | 6 +++--- src/posts.lisp | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/feeds.lisp b/src/feeds.lisp index fa5dc17..2a9bd87 100644 --- a/src/feeds.lisp +++ b/src/feeds.lisp @@ -11,7 +11,7 @@ "Render and write the given FEEDS for the site." (flet ((first-10 (list) (subseq list 0 (min (length list) 10)))) - (let* ((by-date (by-date (hash-table-values *posts*))) + (let* ((by-date (by-date (find-all 'post))) (posts (first-10 by-date)) (rss (make-instance 'index :id "rss.xml" :posts posts)) (atom (make-instance 'index :id "feed.atom" :posts posts))) diff --git a/src/indices.lisp b/src/indices.lisp index e2f8fc2..d486a2e 100644 --- a/src/indices.lisp +++ b/src/indices.lisp @@ -28,7 +28,7 @@ (defun all-months () "Retrieve a list of all months with published posts." - (sort (remove-duplicates (mapcar (lambda (x) (get-month (post-date x))) + (sort (remove-duplicates (mapcar (lambda (x) (get-month (content-date x))) (hash-table-values *content*)) :test #'string=) #'string>)) @@ -51,7 +51,7 @@ (defun index-by-month (month posts) "Return an index of all POSTS matching the given MONTH." - (let ((content (remove-if-not (lambda (post) (search month (post-date post))) + (let ((content (remove-if-not (lambda (post) (search month (content-date post))) posts))) (make-instance 'date-index :id month :posts content @@ -67,7 +67,7 @@ (defun render-indices () "Render the indices to view posts in groups of size N, by month, and by tag." - (let ((posts (by-date (hash-table-values *content*)))) + (let ((posts (by-date (find-all 'post)))) (dolist (tag (all-tags)) (let ((index (index-by-tag tag posts))) (write-page (page-path index) (render-page index)))) diff --git a/src/posts.lisp b/src/posts.lisp index d625bd2..06e23e0 100644 --- a/src/posts.lisp +++ b/src/posts.lisp @@ -14,11 +14,11 @@ (defmethod page-path ((object post)) (rel-path (staging *config*) "posts/~a" (content-slug object))) -(defmethod initialize-instance :after ((post post) &key) +(defmethod initialize-instance :after ((object post) &key) (with-accessors ((title post-title) (format post-format) - (content post-content)) post - (setf (content-slug post) (slugify title) + (content post-content)) object + (setf (content-slug object) (slugify title) format (make-keyword (string-upcase format)) content (render-content content format))))