summaryrefslogtreecommitdiffstats
path: root/hugolib
diff options
context:
space:
mode:
authorAnthony Fok <foka@debian.org>2015-12-01 21:03:17 -0700
committerAnthony Fok <foka@debian.org>2015-12-01 21:03:17 -0700
commit0d1d33d7f3a3867a0dc0a43ee02fd5cb84ec17fd (patch)
tree57e61f7b3d6bcd6eb5097566dc2570ded37b2dfb /hugolib
parentf8302768c794678855c1642007c73b01ed47fe44 (diff)
Print error when /index.html is zero-length
Also print warning (in verbose mode) for other empty pages. See #947
Diffstat (limited to 'hugolib')
-rw-r--r--hugolib/site.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/hugolib/site.go b/hugolib/site.go
index 163ed183b..a8f0599bb 100644
--- a/hugolib/site.go
+++ b/hugolib/site.go
@@ -1478,6 +1478,20 @@ func (s *Site) renderAndWritePage(name string, dest string, d interface{}, layou
transformer := transform.NewChain(transformLinks...)
transformer.Apply(outBuffer, renderBuffer, path)
+ if outBuffer.Len() == 0 {
+ jww.WARN.Printf("%q is rendered empty\n", dest)
+ if dest == "/" {
+ jww.ERROR.Println("=============================================================")
+ jww.ERROR.Println("Your rendered home page is blank: /index.html is zero-length")
+ jww.ERROR.Println(" * Did you specify a theme on the command-line or in your")
+ jww.ERROR.Printf(" %q file? (Current theme: %q)\n", filepath.Base(viper.ConfigFileUsed()), viper.GetString("Theme"))
+ if !viper.GetBool("Verbose") {
+ jww.ERROR.Println(" * For more debugging information, run \"hugo -v\"")
+ }
+ jww.ERROR.Println("=============================================================")
+ }
+ }
+
if err == nil {
if err = s.WriteDestPage(dest, outBuffer); err != nil {
return err