Fix feeds and indices.
This commit is contained in:
parent
6d47244eac
commit
3d1301dc6d
3 changed files with 7 additions and 7 deletions
|
@ -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)))
|
||||
|
|
|
@ -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))))
|
||||
|
|
|
@ -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))))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue