Minor bugfixes and RENDER-POSTS cleanup.

This commit is contained in:
Brit Butler 2012-09-13 01:10:43 -04:00
parent 5161a33c6c
commit 27e8ed0590
3 changed files with 5 additions and 8 deletions

View file

@ -5,6 +5,6 @@ LISP=sbcl
git clone $GIT_REPO $TMP_GIT_CLONE
# Only ccl and sbcl support the eval switch, other lisps require a patch here
$LISP --eval "(ql:quickload 'coleslaw)" --eval "(coleslaw:main)" --eval "(trival-shell:exit)"
$LISP --eval "(ql:quickload 'coleslaw)" --eval "(coleslaw:main)" --eval "(trivial-shell:exit)"
rm -Rf $TMP_GIT_CLONE
exit

View file

@ -66,5 +66,5 @@
(dotimes (i (ceiling (length posts) 10))
(render-page (index-by-n i posts) nil
:prev (and (plusp i) i)
:next (and (< (* i 10) (length posts)) (+ 2 i)))))
:next (and (< (* (1+ i) 10) (length posts)) (+ 2 i)))))
(update-symlink "index.html" "1.html"))

View file

@ -30,12 +30,9 @@
(defun render-posts ()
"Iterate through the files in the repo to render+write the posts out to disk."
(loop with posts = (sort (hash-table-values *posts*) #'string< :key #'post-date)
for i from 1 upto (length posts)
for prev = nil then post
for post = (nth (1- i) posts)
for next = (nth i posts)
do (render-page post nil :prev prev :next next)))
(loop for (prev post next) on (append '(nil) (sort (hash-table-values *posts*)
#'string< :key #'post-date))
while post do (render-page post nil :prev prev :next next)))
(defgeneric render-content (text format)
(:documentation "Compile TEXT from the given FORMAT to HTML for display.")