mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-23 21:53:09 +02:00
metrics: Add simple template metrics feature
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
cb8eb47260
commit
b4a14c25fe
@@ -14,6 +14,7 @@
|
||||
package hugolib
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"html/template"
|
||||
@@ -1730,6 +1731,16 @@ 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.Println(s.draftStats())
|
||||
|
Reference in New Issue
Block a user