]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
Deprecate page.Author and page.Authors
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Wed, 20 Apr 2022 15:08:01 +0000 (17:08 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sat, 23 Apr 2022 20:22:50 +0000 (22:22 +0200)
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.

hugolib/page__meta.go
resources/page/page.go

index 5568aa539c906353038d1526990d9c65ef3fbba6..0c269d57a6461676a5e207f232a2d0bfa11c7319 100644 (file)
@@ -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{}
index 5133f46fa19c9ca57b64a8df1c3ffefaf20c017d..007a2f95426e3918c4fee045e065462b180f6133 100644 (file)
@@ -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
 }