summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2015-08-05 18:17:11 -0400
committerDavid Thompson <dthompson2@worcester.edu>2015-08-05 18:17:11 -0400
commitce95359aab0f2a11a42f80fbf8bb2caed45ef404 (patch)
tree7ef9f6835e5e274b460b146dba69e22afc2ff909
parent49c0dec2e0731e3b05594093fc5ef2d5d1b7a014 (diff)
site: Don't crash if there is no posts directory.
* haunt/site.scm (build-site): Test for the existence of posts directory.
-rw-r--r--haunt/site.scm10
1 files changed, 6 insertions, 4 deletions
diff --git a/haunt/site.scm b/haunt/site.scm
index 05d3f56..52796e4 100644
--- a/haunt/site.scm
+++ b/haunt/site.scm
@@ -95,10 +95,12 @@ BUILDERS: A list of procedures for building pages from posts"
(define (build-site site)
"Build SITE in the appropriate build directory."
- (let ((posts (read-posts (site-posts-directory site)
- (site-post-filter site)
- (site-readers site)
- (site-default-metadata site)))
+ (let ((posts (if (file-exists? (site-posts-directory site))
+ (read-posts (site-posts-directory site)
+ (site-post-filter site)
+ (site-readers site)
+ (site-default-metadata site))
+ '()))
(build-dir (absolute-file-name (site-build-directory site))))
(when (file-exists? build-dir)
(delete-file-recursively build-dir)