diff options
author | Cameron Moore <[email protected]> | 2017-09-26 13:03:04 -0500 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2017-09-26 20:03:04 +0200 |
commit | b4a14c25fe85c41b79497be27ead128502a4dd7b (patch) | |
tree | 99cdbb0d9ab7a7adf137ce492773750aeec8e431 /deps | |
parent | cb8eb472602754b310eaf7a10271149d1e1f5d75 (diff) | |
download | hugo-b4a14c25fe85c41b79497be27ead128502a4dd7b.tar.gz hugo-b4a14c25fe85c41b79497be27ead128502a4dd7b.zip |
metrics: Add simple template metrics feature
Diffstat (limited to 'deps')
-rw-r--r-- | deps/deps.go | 7 |
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 } |