Assorted bugfixes and cleanups.

This commit is contained in:
Brit Butler 2014-08-27 15:45:29 -04:00
parent b3acf878e1
commit b23a398dd5
3 changed files with 6 additions and 12 deletions

View file

@ -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."

View file

@ -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))))

View file

@ -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