|
@@ -36,8 +36,7 @@ If RAW is non-nil, write the content without wrapping it in the base template."
|
36
|
36
|
(run-program "cp" `("-R" ,(namestring dir) ".")))))
|
37
|
37
|
(render-posts)
|
38
|
38
|
(render-indices)
|
39
|
|
- (render-feed))
|
40
|
|
- (deploy staging)))
|
|
39
|
+ (render-feed))))
|
41
|
40
|
|
42
|
41
|
(defun update-symlink (path target)
|
43
|
42
|
"Update the symlink at PATH to point to TARGET."
|
|
@@ -46,18 +45,21 @@ If RAW is non-nil, write the content without wrapping it in the base template."
|
46
|
45
|
(defgeneric deploy (dir)
|
47
|
46
|
(:documentation "Deploy DIR, updating the .prev and .curr symlinks.")
|
48
|
47
|
(:method (dir)
|
49
|
|
- (let ((new-build (app-path "generated/~a" (get-universal-time))))
|
|
48
|
+ (let ((new-build (app-path "generated/~a" (get-universal-time)))
|
|
49
|
+ (prev (merge-pathnames ".prev" (deploy *config*)))
|
|
50
|
+ (curr (merge-pathnames ".curr" (deploy *config*))))
|
50
|
51
|
(ensure-directories-exist new-build)
|
51
|
52
|
(with-current-directory coleslaw-conf:*basedir*
|
52
|
53
|
(run-program "mv" (mapcar #'namestring (list dir new-build)))
|
53
|
|
- (when (probe-file (app-path ".prev"))
|
54
|
|
- (delete-directory-and-files (read-symlink (app-path ".prev"))))
|
55
|
|
- (when (probe-file (app-path ".curr"))
|
56
|
|
- (update-symlink ".prev" (read-symlink (app-path ".curr"))))
|
57
|
|
- (update-symlink ".curr" new-build)))))
|
|
54
|
+ (when (probe-file prev)
|
|
55
|
+ (delete-directory-and-files (read-symlink prev)))
|
|
56
|
+ (when (probe-file curr)
|
|
57
|
+ (update-symlink prev (read-symlink curr)))
|
|
58
|
+ (update-symlink curr new-build)))))
|
58
|
59
|
|
59
|
60
|
(defun main ()
|
60
|
61
|
"Load the user's config, then compile and deploy the blog."
|
61
|
62
|
(load-config)
|
62
|
63
|
(compile-theme)
|
63
|
|
- (compile-blog))
|
|
64
|
+ (compile-blog)
|
|
65
|
+ (deploy (staging *config*)))
|