Deprecate sourceRelativeLinks

Fixes #3028
Closes #3026
Closes #2891
Closes #2691
This commit is contained in:
Bjørn Erik Pedersen 2017-02-11 16:51:22 +07:00
parent 5cc8b58907
commit 234273a5b5
4 changed files with 15 additions and 8 deletions

View file

@ -94,6 +94,13 @@ func NewBlackfriday(c ConfigProvider) *Blackfriday {
jww.FATAL.Printf("Failed to get site rendering config\n%s", err.Error()) jww.FATAL.Printf("Failed to get site rendering config\n%s", err.Error())
} }
if combinedConfig.SourceRelativeLinksEval {
// Remove in Hugo 0.21
Deprecated("blackfriday", "sourceRelativeLinksEval",
`There is no replacement for this feature, as no developer has stepped up to the plate and volunteered to maintain this feature`, false)
}
return combinedConfig return combinedConfig
} }

View file

@ -275,11 +275,11 @@ func InitLoggers() {
// plenty of time to fix their templates. // plenty of time to fix their templates.
func Deprecated(object, item, alternative string, err bool) { func Deprecated(object, item, alternative string, err bool) {
if err { if err {
DistinctErrorLog.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 in Hugo %s. %s.", object, item, NextHugoReleaseVersion(), alternative)
} else { } else {
// Make sure the users see this while avoiding build breakage. This will not lead to an os.Exit(-1) // Make sure the users see this while avoiding build breakage. This will not lead to an os.Exit(-1)
DistinctFeedbackLog.Printf("WARNING: %s's %s is deprecated and will be removed in a future release. Use %s instead.", object, item, alternative) DistinctFeedbackLog.Printf("WARNING: %s's %s is deprecated and will be removed in a future release. %s.", object, item, alternative)
} }
} }

View file

@ -242,20 +242,20 @@ type PageMeta struct {
func (*PageMeta) WordCount() int { func (*PageMeta) WordCount() int {
// Remove in Hugo 0.19 // Remove in Hugo 0.19
helpers.Deprecated("PageMeta", "WordCount", ".WordCount (on Page)", true) helpers.Deprecated("PageMeta", "WordCount", "Use .WordCount (on Page)", true)
return 0 return 0
} }
func (*PageMeta) FuzzyWordCount() int { func (*PageMeta) FuzzyWordCount() int {
// Remove in Hugo 0.19 // Remove in Hugo 0.19
helpers.Deprecated("PageMeta", "FuzzyWordCount", ".FuzzyWordCount (on Page)", true) helpers.Deprecated("PageMeta", "FuzzyWordCount", "Use .FuzzyWordCount (on Page)", true)
return 0 return 0
} }
func (*PageMeta) ReadingTime() int { func (*PageMeta) ReadingTime() int {
// Remove in Hugo 0.19 // Remove in Hugo 0.19
helpers.Deprecated("PageMeta", "ReadingTime", ".ReadingTime (on Page)", true) helpers.Deprecated("PageMeta", "ReadingTime", "Use .ReadingTime (on Page)", true)
return 0 return 0
} }
@ -1580,7 +1580,7 @@ func (p *Page) copy() *Page {
func (p *Page) Now() time.Time { func (p *Page) Now() time.Time {
// Delete in Hugo 0.21 // Delete in Hugo 0.21
helpers.Deprecated("Page", "Now", "now (the template func)", false) helpers.Deprecated("Page", "Now", "Use now (the template func)", false)
return time.Now() return time.Now()
} }
@ -1591,7 +1591,7 @@ func (p *Page) Hugo() *HugoInfo {
func (p *Page) RSSlink() template.HTML { func (p *Page) RSSlink() template.HTML {
// TODO(bep) we cannot have two of these // TODO(bep) we cannot have two of these
// Remove in Hugo 0.20 // Remove in Hugo 0.20
helpers.Deprecated(".Page", "RSSlink", "RSSLink", true) helpers.Deprecated(".Page", "Use RSSlink", "RSSLink", true)
return p.RSSLink return p.RSSLink
} }

View file

@ -291,7 +291,7 @@ func (s *SiteInfo) Param(key interface{}) (interface{}, error) {
// GetParam gets a site parameter value if found, nil if not. // GetParam gets a site parameter value if found, nil if not.
func (s *SiteInfo) GetParam(key string) interface{} { func (s *SiteInfo) GetParam(key string) interface{} {
helpers.Deprecated("SiteInfo", ".GetParam", ".Param", true) helpers.Deprecated("SiteInfo", ".GetParam", "Use .Param", true)
v := s.Params[strings.ToLower(key)] v := s.Params[strings.ToLower(key)]
if v == nil { if v == nil {