aboutsummaryrefslogtreecommitdiffhomepage
path: root/deps
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2018-05-23 10:03:11 +0200
committerBjørn Erik Pedersen <[email protected]>2018-05-23 10:03:11 +0200
commit35ccf06daeaf86176c1341dde4207c3b11653d7a (patch)
tree1191bc00ec7452cea7b399ed9906254b2d57c729 /deps
parent4ddcf52ccc7af3e23109ebaac1f0486087a212ba (diff)
downloadhugo-35ccf06daeaf86176c1341dde4207c3b11653d7a.tar.gz
hugo-35ccf06daeaf86176c1341dde4207c3b11653d7a.zip
Fix some recently broken embedded templates
And add tests for them. Fixes #4757
Diffstat (limited to 'deps')
-rw-r--r--deps/deps.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/deps/deps.go b/deps/deps.go
index 475d678a9..9a502b589 100644
--- a/deps/deps.go
+++ b/deps/deps.go
@@ -23,6 +23,9 @@ type Deps struct {
// The logger to use.
Log *jww.Notepad `json:"-"`
+ // Used to log errors that may repeat itself many times.
+ DistinctErrorLog *helpers.DistinctLogger
+
// The templates to use. This will usually implement the full tpl.TemplateHandler.
Tmpl tpl.TemplateFinder `json:"-"`
@@ -137,9 +140,12 @@ func New(cfg DepsCfg) (*Deps, error) {
timeoutms = 3000
}
+ distinctErrorLogger := helpers.NewDistinctLogger(logger.ERROR)
+
d := &Deps{
Fs: fs,
Log: logger,
+ DistinctErrorLog: distinctErrorLogger,
templateProvider: cfg.TemplateProvider,
translationProvider: cfg.TranslationProvider,
WithTemplate: cfg.WithTemplate,