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):
|
||||
|
||||
* Added a PREVIEW function for REPL use.
|
||||
* Make ATOM and RSS templates a separate "generic" theme. (thanks @woudshoo!)
|
||||
|
||||
## Changes for 0.9 (2013-02-20):
|
||||
|
|
|
@ -81,3 +81,12 @@ compile and deploy the blog."
|
|||
(compile-theme (theme *config*))
|
||||
(compile-blog (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)
|
||||
(:import-from :closure-template #:compile-template)
|
||||
(:export #:main
|
||||
#:preview
|
||||
#:*config*
|
||||
#:blog
|
||||
#:content
|
||||
|
|
Loading…
Add table
Reference in a new issue