hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit b277cb33e4dfa7440fca3b7888026944ce056154
parent a354d130dc8aaab8bdaf7223af3aa862db44c9d5
Author: Cameron Moore <moorereason@gmail.com>
Date:   Wed, 27 Sep 2017 14:17:43 -0500

hugolib: Move metrics output to the end of the site build

Diffstat:
Mhugolib/hugo_sites_build.go | 10++++++++++
Mhugolib/site.go | 14+-------------
2 files changed, 11 insertions(+), 13 deletions(-)
diff --git a/hugolib/hugo_sites_build.go b/hugolib/hugo_sites_build.go
@@ -14,6 +14,7 @@
 package hugolib
 
 import (
+	"bytes"
 	"time"
 
 	"errors"
@@ -66,6 +67,15 @@ func (h *HugoSites) Build(config BuildCfg, events ...fsnotify.Event) error {
 		h.Log.FEEDBACK.Printf("total in %v ms\n", int(1000*time.Since(t0).Seconds()))
 	}
 
+	if h.Metrics != nil {
+		var b bytes.Buffer
+		h.Metrics.WriteMetrics(&b)
+
+		h.Log.FEEDBACK.Printf("\nTemplate Metrics:\n\n")
+		h.Log.FEEDBACK.Print(b.String())
+		h.Log.FEEDBACK.Println()
+	}
+
 	return nil
 
 }
diff --git a/hugolib/site.go b/hugolib/site.go
@@ -14,7 +14,6 @@
 package hugolib
 
 import (
-	"bytes"
 	"errors"
 	"fmt"
 	"html/template"
@@ -1731,18 +1730,7 @@ func (s *Site) appendThemeTemplates(in []string) []string {
 // Stats prints Hugo builds stats to the console.
 // This is what you see after a successful hugo build.
 func (s *Site) Stats() {
-	s.Log.FEEDBACK.Println()
-
-	if s.Cfg.GetBool("templateMetrics") {
-		var b bytes.Buffer
-		s.Metrics.WriteMetrics(&b)
-
-		s.Log.FEEDBACK.Printf("Template Metrics:\n\n")
-		s.Log.FEEDBACK.Print(b.String())
-		s.Log.FEEDBACK.Println()
-	}
-
-	s.Log.FEEDBACK.Printf("Built site for language %s:\n", s.Language.Lang)
+	s.Log.FEEDBACK.Printf("\nBuilt site for language %s:\n", s.Language.Lang)
 	s.Log.FEEDBACK.Println(s.draftStats())
 	s.Log.FEEDBACK.Println(s.futureStats())
 	s.Log.FEEDBACK.Println(s.expiredStats())