mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
Revise the deprecation logging
This introduces a more automatic way of increasing the log levels for deprecation log statements based on the version it was deprecated. The thresholds are a little arbitrary, but * We log INFO for 6 releases * We log WARN for another 6 releases * THen ERROR (failing the build) This should give theme authors plenty of time to catch up without having the log filled with warnings.
This commit is contained in:
@@ -130,7 +130,7 @@ func (p *pageMeta) Aliases() []string {
|
||||
}
|
||||
|
||||
func (p *pageMeta) Author() page.Author {
|
||||
helpers.Deprecated(".Author", "Use taxonomies.", false)
|
||||
hugo.Deprecate(".Author", "Use taxonomies.", "v0.98.0")
|
||||
authors := p.Authors()
|
||||
|
||||
for _, author := range authors {
|
||||
@@ -140,7 +140,7 @@ func (p *pageMeta) Author() page.Author {
|
||||
}
|
||||
|
||||
func (p *pageMeta) Authors() page.AuthorList {
|
||||
helpers.Deprecated(".Authors", "Use taxonomies.", true)
|
||||
hugo.Deprecate(".Author", "Use taxonomies.", "v0.112.0")
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -226,7 +226,7 @@ func (p *pageMeta) Path() string {
|
||||
{{ $path = .Path }}
|
||||
{{ end }}
|
||||
`
|
||||
helpers.Deprecated(".Path when the page is backed by a file", "We plan to use Path for a canonical source path and you probably want to check the source is a file. To get the current behaviour, you can use a construct similar to the one below:\n"+example, false)
|
||||
p.s.Log.Warnln(".Path when the page is backed by a file is deprecated. We plan to use Path for a canonical source path and you probably want to check the source is a file. To get the current behaviour, you can use a construct similar to the one below:\n" + example)
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user