From ff2b98c9dd23d0b0bcc6d0a961f373911eee6bef Mon Sep 17 00:00:00 2001 From: spf13 Date: Sun, 29 Sep 2013 02:07:05 -0400 Subject: [PATCH] Better error message when no source content is found. --- hugolib/site.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hugolib/site.go b/hugolib/site.go index 2e16094b9..58f770d5a 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -247,6 +247,12 @@ func (s *Site) ProcessShortcodes() { } func (s *Site) CreatePages() (err error) { + if s.Source == nil { + return fmt.Errorf("No source files found in", s.absContentDir()) + } + if len(s.Source.Files()) < 1 { + return fmt.Errorf("No source files found in", s.absContentDir()) + } for _, file := range s.Source.Files() { page, err := ReadFrom(file.Contents, file.LogicalName) if err != nil {