From: Bjørn Erik Pedersen Date: Wed, 20 Apr 2022 15:08:01 +0000 (+0200) Subject: Deprecate page.Author and page.Authors X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=097fd588ca2928056122991caaa879e835c5ba62;p=brevno-suite%2Fhugo Deprecate page.Author and page.Authors These are not documented, and they don't belong on Page. We should consider having author a first class citizen of Hugo, but as it is not it's better modelled as a taxonomy. --- diff --git a/hugolib/page__meta.go b/hugolib/page__meta.go index 5568aa539..0c269d57a 100644 --- a/hugolib/page__meta.go +++ b/hugolib/page__meta.go @@ -131,6 +131,7 @@ func (p *pageMeta) Aliases() []string { } func (p *pageMeta) Author() page.Author { + helpers.Deprecated(".Author", "Use taxonomies.", false) authors := p.Authors() for _, author := range authors { @@ -140,6 +141,7 @@ func (p *pageMeta) Author() page.Author { } func (p *pageMeta) Authors() page.AuthorList { + helpers.Deprecated(".Authors", "Use taxonomies.", false) authorKeys, ok := p.params["authors"] if !ok { return page.AuthorList{} diff --git a/resources/page/page.go b/resources/page/page.go index 5133f46fa..007a2f954 100644 --- a/resources/page/page.go +++ b/resources/page/page.go @@ -52,7 +52,9 @@ type AlternativeOutputFormatsProvider interface { // AuthorProvider provides author information. type AuthorProvider interface { + // Deprecated. Author() Author + // Deprecated. Authors() AuthorList } @@ -118,6 +120,7 @@ type InSectionPositioner interface { // InternalDependencies is considered an internal interface. type InternalDependencies interface { + // GetRelatedDocsHandler is for internal use only. GetRelatedDocsHandler() *RelatedDocsHandler }