]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
hugolib: Conditionally suppress .Site.Author deprecation notice
authorJoe Mooring <joe.mooring@veriphor.com>
Fri, 22 Mar 2024 20:02:56 +0000 (13:02 -0700)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 26 Mar 2024 09:28:03 +0000 (10:28 +0100)
Suppress the .Site.Author deprecation notice unless the Author key
is present and not empty in the site configuration.

Closes #12297

hugolib/site_new.go

index 97b46e3584e75da8760c2c458981a58f16609cb5..59b97e887eb6b427b8646163bcc36b087c0e96a3 100644 (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
 }