Add and export PREVIEW.
This commit is contained in:
parent
dfc5be16aa
commit
6082cb46f5
3 changed files with 11 additions and 0 deletions
1
NEWS.md
1
NEWS.md
|
@ -1,5 +1,6 @@
|
||||||
## Changes for 0.9.1 (2013-04-xx):
|
## Changes for 0.9.1 (2013-04-xx):
|
||||||
|
|
||||||
|
* Added a PREVIEW function for REPL use.
|
||||||
* Make ATOM and RSS templates a separate "generic" theme. (thanks @woudshoo!)
|
* Make ATOM and RSS templates a separate "generic" theme. (thanks @woudshoo!)
|
||||||
|
|
||||||
## Changes for 0.9 (2013-02-20):
|
## Changes for 0.9 (2013-02-20):
|
||||||
|
|
|
@ -81,3 +81,12 @@ compile and deploy the blog."
|
||||||
(compile-theme (theme *config*))
|
(compile-theme (theme *config*))
|
||||||
(compile-blog (staging *config*))
|
(compile-blog (staging *config*))
|
||||||
(deploy (staging *config*))))
|
(deploy (staging *config*))))
|
||||||
|
|
||||||
|
(defun preview (path &optional (content-type 'post))
|
||||||
|
"Render the content at PATH and save it to ~/tmp.html, loading the
|
||||||
|
user's config and theme if necessary."
|
||||||
|
(unless *config*
|
||||||
|
(load-config nil)
|
||||||
|
(compile-theme (theme *config*)))
|
||||||
|
(let ((object (construct content-type (read-content path))))
|
||||||
|
(write-page "~/tmp.html" (render-page object))))
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#:compose)
|
#:compose)
|
||||||
(:import-from :closure-template #:compile-template)
|
(:import-from :closure-template #:compile-template)
|
||||||
(:export #:main
|
(:export #:main
|
||||||
|
#:preview
|
||||||
#:*config*
|
#:*config*
|
||||||
#:blog
|
#:blog
|
||||||
#:content
|
#:content
|
||||||
|
|
Loading…
Add table
Reference in a new issue