|
@@ -23,33 +23,34 @@ on files that match the given extension."
|
23
|
23
|
|
24
|
24
|
(defun render-page (path html)
|
25
|
25
|
"Populate the base template with the provided HTML and write it out to PATH."
|
26
|
|
- (ensure-directories-exist path)
|
27
|
|
- (with-open-file (out path
|
28
|
|
- :direction :output
|
29
|
|
- :if-does-not-exist :create)
|
30
|
|
- (let ((content (funcall (theme-fn "BASE")
|
31
|
|
- (list :title (title *config*)
|
32
|
|
- :siteroot (domain *config*)
|
33
|
|
- :navigation (sitenav *config*)
|
34
|
|
- :content html
|
35
|
|
- :head-inject (apply #'concatenate 'string
|
36
|
|
- (gethash :head *injections*))
|
37
|
|
- :body-inject (apply #'concatenate 'string
|
38
|
|
- (gethash :body *injections*))
|
39
|
|
- :license (license *config*)
|
40
|
|
- :credits (author *config*)))))
|
41
|
|
- (write-line content out))))
|
|
26
|
+ (let ((filepath (merge-pathnames path (staging *config*))))
|
|
27
|
+ (ensure-directories-exist filepath)
|
|
28
|
+ (with-open-file (out path
|
|
29
|
+ :direction :output
|
|
30
|
+ :if-does-not-exist :create)
|
|
31
|
+ (let ((content (funcall (theme-fn "BASE")
|
|
32
|
+ (list :title (title *config*)
|
|
33
|
+ :siteroot (domain *config*)
|
|
34
|
+ :navigation (sitenav *config*)
|
|
35
|
+ :content html
|
|
36
|
+ :head-inject (apply #'concatenate 'string
|
|
37
|
+ (gethash :head *injections*))
|
|
38
|
+ :body-inject (apply #'concatenate 'string
|
|
39
|
+ (gethash :body *injections*))
|
|
40
|
+ :license (license *config*)
|
|
41
|
+ :credits (author *config*)))))
|
|
42
|
+ (write-line content out)))))
|
42
|
43
|
|
43
|
44
|
(defun compile-blog ()
|
44
|
45
|
"Compile the blog to a staging directory in /tmp."
|
45
|
|
- (let ((staging #p"/tmp/coleslaw/"))
|
|
46
|
+ (let ((staging (staging *config*)))
|
46
|
47
|
; TODO: More incremental compilation? Don't regen whole blog unnecessarily.
|
47
|
48
|
(when (probe-file staging)
|
48
|
49
|
(delete-directory-and-files staging))
|
49
|
50
|
(ensure-directories-exist staging)
|
50
|
51
|
(with-current-directory staging
|
51
|
|
- (let ((css-dir (app-path "themes/~a/css/" (theme *config*)))
|
52
|
|
- (static-dir (merge-pathnames "static/" (repo *config*))))
|
|
52
|
+ (let ((css-dir (app-path "themes/~a/css" (theme *config*)))
|
|
53
|
+ (static-dir (merge-pathnames "static" (repo *config*))))
|
53
|
54
|
(dolist (dir (list css-dir static-dir))
|
54
|
55
|
(when (probe-file dir)
|
55
|
56
|
(run-program "cp" `("-R" ,(namestring dir) ".")))))
|