From b23a398dd5adb35ec4b1cb765b51f0ec928d2592 Mon Sep 17 00:00:00 2001 From: Brit Butler Date: Wed, 27 Aug 2014 15:45:29 -0400 Subject: [PATCH] Assorted bugfixes and cleanups. --- src/coleslaw.lisp | 3 +-- src/feeds.lisp | 7 +++---- src/indexes.lisp | 8 ++------ 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/coleslaw.lisp b/src/coleslaw.lisp index 36642ea..e50df1d 100644 --- a/src/coleslaw.lisp +++ b/src/coleslaw.lisp @@ -41,8 +41,7 @@ in REPO-DIR. Optionally, OLDREV is the revision prior to the last push." (defgeneric deploy (staging) (:documentation "Deploy the STAGING build to the directory specified in the config.") (:method (staging) - (let ((destination (deploy-dir *config*))) - (run-program "rsync --delete -avz ~a ~a" staging destination)))) + (run-program "mv ~a ~a" staging (deploy-dir *config*)))) (defun update-symlink (path target) "Update the symlink at PATH to point to TARGET." diff --git a/src/feeds.lisp b/src/feeds.lisp index 7d273fc..a0aaeef 100644 --- a/src/feeds.lisp +++ b/src/feeds.lisp @@ -2,10 +2,9 @@ ;;; Atom and RSS Feeds -(defclass feed (index) - ((format :initform nil :initarg :format :reader feed-format))) +(defclass feed () ((format :initarg :format :reader feed-format))) -(defclass standard-feed (feed) ()) +(defclass standard-feed (index feed) ()) (defmethod discover ((doc-type (eql (find-class 'standard-feed)))) (let ((content (by-date (find-all 'post)))) @@ -21,7 +20,7 @@ ;;; Tag Feeds -(defclass tag-feed (feed) ()) +(defclass tag-feed (index feed) ()) (defmethod discover ((doc-type (eql (find-class 'tag-feed)))) (let ((content (by-date (find-all 'post)))) diff --git a/src/indexes.lisp b/src/indexes.lisp index 40b295c..6cbf056 100644 --- a/src/indexes.lisp +++ b/src/indexes.lisp @@ -79,12 +79,8 @@ (defmethod publish ((doc-type (eql (find-class 'numeric-index)))) (let ((indexes (sort (find-all 'numeric-index) #'< :key #'index-name))) - (dolist (index indexes) - (let ((prev (1- (index-name index))) - (next (1+ (index-name index)))) - (write-document index nil - :prev (when (plusp prev) prev) - :next (when (<= next (length indexes)) next)))))) + (loop for (next index prev) on (append '(nil) indexes) + while index do (write-document index nil :prev prev :next next)))) ;;; Helper Functions