diff options
author | Bjørn Erik Pedersen <[email protected]> | 2020-09-07 15:07:10 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2020-09-07 21:06:44 +0200 |
commit | 4055c121847847d8bd6b95a928185daee065091b (patch) | |
tree | 6620f51e7e89aa7ff0a9a93361d640ee5b297fea /tpl/fmt | |
parent | 3ba7c92530a80f2f04fe57705ab05c247a6e8437 (diff) | |
download | hugo-4055c121847847d8bd6b95a928185daee065091b.tar.gz hugo-4055c121847847d8bd6b95a928185daee065091b.zip |
Fix some change detection issues on server reloads
* Fix change detection when .GetPage/site.GetPage is used from shortcode
* Fix stale content for GetPage results with short name lookups on server reloads
Fixes #7623
Fixes #7624
Fixes #7625
Diffstat (limited to 'tpl/fmt')
-rw-r--r-- | tpl/fmt/fmt.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tpl/fmt/fmt.go b/tpl/fmt/fmt.go index aa6b8c1a6..924d27a1d 100644 --- a/tpl/fmt/fmt.go +++ b/tpl/fmt/fmt.go @@ -23,10 +23,17 @@ import ( // New returns a new instance of the fmt-namespaced template functions. func New(d *deps.Deps) *Namespace { - return &Namespace{ + ns := &Namespace{ errorLogger: helpers.NewDistinctLogger(d.Log.ERROR), warnLogger: helpers.NewDistinctLogger(d.Log.WARN), } + + d.BuildStartListeners.Add(func() { + ns.errorLogger.Reset() + ns.warnLogger.Reset() + }) + + return ns } // Namespace provides template functions for the "fmt" namespace. |