Add staging config option. Tweak defaults.
This commit is contained in:
parent
1c0a037bac
commit
43501458c1
2 changed files with 22 additions and 20 deletions
|
@ -23,7 +23,8 @@ on files that match the given extension."
|
||||||
|
|
||||||
(defun render-page (path html)
|
(defun render-page (path html)
|
||||||
"Populate the base template with the provided HTML and write it out to PATH."
|
"Populate the base template with the provided HTML and write it out to PATH."
|
||||||
(ensure-directories-exist path)
|
(let ((filepath (merge-pathnames path (staging *config*))))
|
||||||
|
(ensure-directories-exist filepath)
|
||||||
(with-open-file (out path
|
(with-open-file (out path
|
||||||
:direction :output
|
:direction :output
|
||||||
:if-does-not-exist :create)
|
:if-does-not-exist :create)
|
||||||
|
@ -38,18 +39,18 @@ on files that match the given extension."
|
||||||
(gethash :body *injections*))
|
(gethash :body *injections*))
|
||||||
:license (license *config*)
|
:license (license *config*)
|
||||||
:credits (author *config*)))))
|
:credits (author *config*)))))
|
||||||
(write-line content out))))
|
(write-line content out)))))
|
||||||
|
|
||||||
(defun compile-blog ()
|
(defun compile-blog ()
|
||||||
"Compile the blog to a staging directory in /tmp."
|
"Compile the blog to a staging directory in /tmp."
|
||||||
(let ((staging #p"/tmp/coleslaw/"))
|
(let ((staging (staging *config*)))
|
||||||
; TODO: More incremental compilation? Don't regen whole blog unnecessarily.
|
; TODO: More incremental compilation? Don't regen whole blog unnecessarily.
|
||||||
(when (probe-file staging)
|
(when (probe-file staging)
|
||||||
(delete-directory-and-files staging))
|
(delete-directory-and-files staging))
|
||||||
(ensure-directories-exist staging)
|
(ensure-directories-exist staging)
|
||||||
(with-current-directory staging
|
(with-current-directory staging
|
||||||
(let ((css-dir (app-path "themes/~a/css/" (theme *config*)))
|
(let ((css-dir (app-path "themes/~a/css" (theme *config*)))
|
||||||
(static-dir (merge-pathnames "static/" (repo *config*))))
|
(static-dir (merge-pathnames "static" (repo *config*))))
|
||||||
(dolist (dir (list css-dir static-dir))
|
(dolist (dir (list css-dir static-dir))
|
||||||
(when (probe-file dir)
|
(when (probe-file dir)
|
||||||
(run-program "cp" `("-R" ,(namestring dir) ".")))))
|
(run-program "cp" `("-R" ,(namestring dir) ".")))))
|
||||||
|
|
|
@ -4,10 +4,11 @@
|
||||||
((author :initarg :author :initform "" :accessor author)
|
((author :initarg :author :initform "" :accessor author)
|
||||||
(domain :initarg :domain :initform "" :accessor domain)
|
(domain :initarg :domain :initform "" :accessor domain)
|
||||||
(interval :initarg :interval :initform 600 :accessor interval)
|
(interval :initarg :interval :initform 600 :accessor interval)
|
||||||
(license :initarg :license :initform "" :accessor license)
|
(license :initarg :license :initform "CC-BY-SA" :accessor license)
|
||||||
(plugins :initarg :plugins :initform '() :accessor plugins)
|
(plugins :initarg :plugins :initform '() :accessor plugins)
|
||||||
(repo :initarg :repo :initform #p"/" :accessor repo)
|
(repo :initarg :repo :initform #p"/" :accessor repo)
|
||||||
(sitenav :initarg :sitenav :initform "" :accessor sitenav)
|
(sitenav :initarg :sitenav :initform "" :accessor sitenav)
|
||||||
|
(staging :initarg :staging :initform #p"/tmp/coleslaw/" :accessor staging)
|
||||||
(title :initarg :title :initform "" :accessor title)
|
(title :initarg :title :initform "" :accessor title)
|
||||||
(theme :initarg :theme :initform "hyde" :accessor theme)))
|
(theme :initarg :theme :initform "hyde" :accessor theme)))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue