diff options
author | Bjørn Erik Pedersen <[email protected]> | 2016-09-28 11:05:21 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2016-09-28 11:05:21 +0200 |
commit | 614dd2aa16942bb182b3a69bc045b963ed5de9b8 (patch) | |
tree | 30efdc38a355a0ae66fa9da557ef14b26e5b791c | |
parent | 59df7db764d011b6e082d11d4660e9c8833a3b75 (diff) | |
download | hugo-614dd2aa16942bb182b3a69bc045b963ed5de9b8.tar.gz hugo-614dd2aa16942bb182b3a69bc045b963ed5de9b8.zip |
Deprecate PageMeta.WordCount etc.
Fix #2503
-rw-r--r-- | helpers/general.go | 2 | ||||
-rw-r--r-- | hugolib/page.go | 16 |
2 files changed, 17 insertions, 1 deletions
diff --git a/helpers/general.go b/helpers/general.go index 7fac7cb59..b420bfa2c 100644 --- a/helpers/general.go +++ b/helpers/general.go @@ -237,7 +237,7 @@ func InitLoggers() { // Deprecated logs ERROR logs about a deprecation, but only once for a given set of arguments' values. func Deprecated(object, item, alternative string) { // deprecatedLogger.Printf("%s's %s is deprecated and will be removed in Hugo %s. Use %s instead.", object, item, NextHugoReleaseVersion(), alternative) - DistinctErrorLog.Printf("%s's %s is deprecated and will be removed VERY SOON. Use %s instead.", object, item, alternative) + DistinctErrorLog.Printf("%s's %s is deprecated and will be removed in a future release. Use %s instead.", object, item, alternative) } diff --git a/hugolib/page.go b/hugolib/page.go index fa43f4d4e..abd56b3ea 100644 --- a/hugolib/page.go +++ b/hugolib/page.go @@ -114,6 +114,22 @@ type PageMeta struct { Weight int } +func (*PageMeta) WordCount() int { + helpers.Deprecated("PageMeta", "WordCount", ".WordCount (on Page)") + return 0 +} + +func (*PageMeta) FuzzyWordCount() int { + helpers.Deprecated("PageMeta", "FuzzyWordCount", ".FuzzyWordCount (on Page)") + return 0 + +} + +func (*PageMeta) ReadingTime() int { + helpers.Deprecated("PageMeta", "ReadingTime", ".ReadingTime (on Page)") + return 0 +} + type Position struct { Prev *Page Next *Page |