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) (defgeneric deploy (staging)
(:documentation "Deploy the STAGING build to the directory specified in the config.") (:documentation "Deploy the STAGING build to the directory specified in the config.")
(:method (staging) (:method (staging)
(let ((destination (deploy-dir *config*))) (run-program "mv ~a ~a" staging (deploy-dir *config*))))
(run-program "rsync --delete -avz ~a ~a" staging destination))))
(defun update-symlink (path target) (defun update-symlink (path target)
"Update the symlink at PATH to point to TARGET." "Update the symlink at PATH to point to TARGET."

View file

@ -2,10 +2,9 @@
;;; Atom and RSS Feeds ;;; Atom and RSS Feeds
(defclass feed (index) (defclass feed () ((format :initarg :format :reader feed-format)))
((format :initform nil :initarg :format :reader feed-format)))
(defclass standard-feed (feed) ()) (defclass standard-feed (index feed) ())
(defmethod discover ((doc-type (eql (find-class 'standard-feed)))) (defmethod discover ((doc-type (eql (find-class 'standard-feed))))
(let ((content (by-date (find-all 'post)))) (let ((content (by-date (find-all 'post))))
@ -21,7 +20,7 @@
;;; Tag Feeds ;;; Tag Feeds
(defclass tag-feed (feed) ()) (defclass tag-feed (index feed) ())
(defmethod discover ((doc-type (eql (find-class 'tag-feed)))) (defmethod discover ((doc-type (eql (find-class 'tag-feed))))
(let ((content (by-date (find-all 'post)))) (let ((content (by-date (find-all 'post))))

View file

@ -79,12 +79,8 @@
(defmethod publish ((doc-type (eql (find-class 'numeric-index)))) (defmethod publish ((doc-type (eql (find-class 'numeric-index))))
(let ((indexes (sort (find-all 'numeric-index) #'< :key #'index-name))) (let ((indexes (sort (find-all 'numeric-index) #'< :key #'index-name)))
(dolist (index indexes) (loop for (next index prev) on (append '(nil) indexes)
(let ((prev (1- (index-name index))) while index do (write-document index nil :prev prev :next next))))
(next (1+ (index-name index))))
(write-document index nil
:prev (when (plusp prev) prev)
:next (when (<= next (length indexes)) next))))))
;;; Helper Functions ;;; Helper Functions