site: Don't crash if there is no posts directory.

* haunt/site.scm (build-site): Test for the existence of posts
  directory.
This commit is contained in:
David Thompson 2015-08-05 18:17:11 -04:00
parent 49c0dec2e0
commit ce95359aab
1 changed files with 6 additions and 4 deletions

View File

@ -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)
(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)))
(site-default-metadata site))
'()))
(build-dir (absolute-file-name (site-build-directory site))))
(when (file-exists? build-dir)
(delete-file-recursively build-dir)