Revise the deprecation strategy

Git users and theme authors two Hugo releases to fix:

1. With a visible warning
2. Then with an ERROR that exits with -1

Fixes #2726
This commit is contained in:
Bjørn Erik Pedersen
2016-11-23 17:26:13 +01:00
parent 0a0db9cd25
commit f1ed89fec4
4 changed files with 25 additions and 11 deletions

View File

@@ -242,18 +242,18 @@ type PageMeta struct {
}
func (*PageMeta) WordCount() int {
helpers.Deprecated("PageMeta", "WordCount", ".WordCount (on Page)")
helpers.Deprecated("PageMeta", "WordCount", ".WordCount (on Page)", true)
return 0
}
func (*PageMeta) FuzzyWordCount() int {
helpers.Deprecated("PageMeta", "FuzzyWordCount", ".FuzzyWordCount (on Page)")
helpers.Deprecated("PageMeta", "FuzzyWordCount", ".FuzzyWordCount (on Page)", true)
return 0
}
func (*PageMeta) ReadingTime() int {
helpers.Deprecated("PageMeta", "ReadingTime", ".ReadingTime (on Page)")
helpers.Deprecated("PageMeta", "ReadingTime", ".ReadingTime (on Page)", true)
return 0
}
@@ -1565,7 +1565,7 @@ func (p *Page) Hugo() *HugoInfo {
func (p *Page) RSSlink() template.HTML {
// TODO(bep) we cannot have two of these
helpers.Deprecated(".Page", "RSSlink", "RSSLink")
helpers.Deprecated(".Page", "RSSlink", "RSSLink", false)
return p.RSSLink
}