diff options
author | David Thompson <dthompson2@worcester.edu> | 2015-08-05 18:17:11 -0400 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2015-08-05 18:17:11 -0400 |
commit | ce95359aab0f2a11a42f80fbf8bb2caed45ef404 (patch) | |
tree | 7ef9f6835e5e274b460b146dba69e22afc2ff909 | |
parent | 49c0dec2e0731e3b05594093fc5ef2d5d1b7a014 (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.scm | 10 |
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) |