summaryrefslogtreecommitdiffstats
path: root/tpl
diff options
context:
space:
mode:
Diffstat (limited to 'tpl')
-rw-r--r--tpl/debug/debug.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/tpl/debug/debug.go b/tpl/debug/debug.go
index dd0593e27..f603dd94d 100644
--- a/tpl/debug/debug.go
+++ b/tpl/debug/debug.go
@@ -24,6 +24,7 @@ import (
"github.com/spf13/cast"
"github.com/yuin/goldmark/util"
+ "github.com/gohugoio/hugo/common/hugo"
"github.com/gohugoio/hugo/deps"
)
@@ -156,3 +157,26 @@ func (t *timer) Stop() string {
// This is used in templates, we need to return something.
return ""
}
+
+// Internal template func, used in tests only.
+func (ns *Namespace) TestDeprecationInfo(item, alternative string) string {
+ v := hugo.CurrentVersion
+ hugo.Deprecate(item, alternative, v.String())
+ return ""
+}
+
+// Internal template func, used in tests only.
+func (ns *Namespace) TestDeprecationWarn(item, alternative string) string {
+ v := hugo.CurrentVersion
+ v.Minor -= 6
+ hugo.Deprecate(item, alternative, v.String())
+ return ""
+}
+
+// Internal template func, used in tests only.
+func (ns *Namespace) TestDeprecationErr(item, alternative string) string {
+ v := hugo.CurrentVersion
+ v.Minor -= 12
+ hugo.Deprecate(item, alternative, v.String())
+ return ""
+}