Tweak the language in indices.

This commit is contained in:
Brit Butler 2013-01-02 14:23:56 -05:00
parent a1c894c49d
commit f2ccd8829f

View file

@ -27,13 +27,13 @@
(rel-path (staging *config*) "~d" (index-id object))) (rel-path (staging *config*) "~d" (index-id object)))
(defun all-months () (defun all-months ()
"Retrieve a list of all months with published posts." "Retrieve a list of all months with published content."
(sort (remove-duplicates (mapcar (lambda (x) (get-month (content-date x))) (sort (remove-duplicates (mapcar (lambda (x) (get-month (content-date x)))
(hash-table-values *content*)) :test #'string=) (hash-table-values *content*)) :test #'string=)
#'string>)) #'string>))
(defun all-tags () (defun all-tags ()
"Retrieve a list of all tags used in posts." "Retrieve a list of all tags used in content."
(sort (remove-duplicates (mappend 'content-tags (hash-table-values *content*)) (sort (remove-duplicates (mappend 'content-tags (hash-table-values *content*))
:test #'string=) #'string<)) :test #'string=) #'string<))
@ -41,28 +41,28 @@
"Extract the YYYY-MM portion of TIMESTAMP." "Extract the YYYY-MM portion of TIMESTAMP."
(subseq timestamp 0 7)) (subseq timestamp 0 7))
(defun index-by-tag (tag posts) (defun index-by-tag (tag content)
"Return an index of all POSTS matching the given TAG." "Return an index of all CONTENT matching the given TAG."
(let ((content (remove-if-not (lambda (post) (member tag (content-tags post) (let ((results (remove-if-not (lambda (obj) (member tag (content-tags obj)
:test #'string=)) posts))) :test #'string=)) content)))
(make-instance 'tag-index :id tag (make-instance 'tag-index :id tag
:posts content :posts results
:title (format nil "Posts tagged ~a" tag)))) :title (format nil "Posts tagged ~a" tag))))
(defun index-by-month (month posts) (defun index-by-month (month content)
"Return an index of all POSTS matching the given MONTH." "Return an index of all CONTENT matching the given MONTH."
(let ((content (remove-if-not (lambda (post) (search month (content-date post))) (let ((results (remove-if-not (lambda (obj) (search month (content-date obj)))
posts))) content)))
(make-instance 'date-index :id month (make-instance 'date-index :id month
:posts content :posts results
:title (format nil "Posts from ~a" month)))) :title (format nil "Posts from ~a" month))))
(defun index-by-n (i posts &optional (step 10)) (defun index-by-n (i content &optional (step 10))
"Return the index for the Ith page of POSTS in reverse chronological order." "Return the index for the Ith page of CONTENT in reverse chronological order."
(make-instance 'int-index :id (1+ i) (make-instance 'int-index :id (1+ i)
:posts (let ((index (* step i))) :posts (let ((index (* step i)))
(subseq posts index (min (length posts) (subseq content index (min (length content)
(+ index step)))) (+ index step))))
:title "Recent Posts")) :title "Recent Posts"))
(defun render-indices () (defun render-indices ()