From ce95359aab0f2a11a42f80fbf8bb2caed45ef404 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Wed, 5 Aug 2015 18:17:11 -0400 Subject: site: Don't crash if there is no posts directory. * haunt/site.scm (build-site): Test for the existence of posts directory. --- haunt/site.scm | 10 ++++++---- 1 file 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) -- cgit v1.2.3