aboutsummaryrefslogtreecommitdiffhomepage
path: root/deps
diff options
context:
space:
mode:
authorCameron Moore <[email protected]>2017-09-26 13:03:04 -0500
committerBjørn Erik Pedersen <[email protected]>2017-09-26 20:03:04 +0200
commitb4a14c25fe85c41b79497be27ead128502a4dd7b (patch)
tree99cdbb0d9ab7a7adf137ce492773750aeec8e431 /deps
parentcb8eb472602754b310eaf7a10271149d1e1f5d75 (diff)
downloadhugo-b4a14c25fe85c41b79497be27ead128502a4dd7b.tar.gz
hugo-b4a14c25fe85c41b79497be27ead128502a4dd7b.zip
metrics: Add simple template metrics feature
Diffstat (limited to 'deps')
-rw-r--r--deps/deps.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/deps/deps.go b/deps/deps.go
index d8ba3313e..0c610c9ba 100644
--- a/deps/deps.go
+++ b/deps/deps.go
@@ -8,6 +8,7 @@ import (
"github.com/gohugoio/hugo/config"
"github.com/gohugoio/hugo/helpers"
"github.com/gohugoio/hugo/hugofs"
+ "github.com/gohugoio/hugo/metrics"
"github.com/gohugoio/hugo/output"
"github.com/gohugoio/hugo/tpl"
jww "github.com/spf13/jwalterweatherman"
@@ -47,6 +48,8 @@ type Deps struct {
WithTemplate func(templ tpl.TemplateHandler) error `json:"-"`
translationProvider ResourceProvider
+
+ Metrics metrics.Provider
}
// ResourceProvider is used to create and refresh, and clone resources needed.
@@ -131,6 +134,10 @@ func New(cfg DepsCfg) (*Deps, error) {
Language: cfg.Language,
}
+ if cfg.Cfg.GetBool("templateMetrics") {
+ d.Metrics = metrics.NewProvider()
+ }
+
return d, nil
}