hugolib: Conditionally suppress .Site.Author deprecation notice

Suppress the .Site.Author deprecation notice unless the Author key
is present and not empty in the site configuration.

Closes #12297
This commit is contained in:
Joe Mooring 2024-03-22 13:02:56 -07:00 committed by Bjørn Erik Pedersen
parent 27414d43a0
commit e1917740af

View file

@ -449,7 +449,9 @@ func (s *Site) Params() maps.Params {
// Deprecated: Use taxonomies instead.
func (s *Site) Author() map[string]any {
hugo.Deprecate(".Site.Author", "Use taxonomies instead.", "v0.124.0")
if len(s.conf.Author) != 0 {
hugo.Deprecate(".Site.Author", "Use taxonomies instead.", "v0.124.0")
}
return s.conf.Author
}