Skip to content

Commit

Permalink
Deprecate page.Author and page.Authors
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bep committed Apr 23, 2022
1 parent 41cc4e4 commit 097fd58
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions hugolib/page__meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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{}
Expand Down
3 changes: 3 additions & 0 deletions resources/page/page.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ type AlternativeOutputFormatsProvider interface {

// AuthorProvider provides author information.
type AuthorProvider interface {
// Deprecated.
Author() Author
// Deprecated.
Authors() AuthorList
}

Expand Down Expand Up @@ -118,6 +120,7 @@ type InSectionPositioner interface {

// InternalDependencies is considered an internal interface.
type InternalDependencies interface {
// GetRelatedDocsHandler is for internal use only.
GetRelatedDocsHandler() *RelatedDocsHandler
}

Expand Down

0 comments on commit 097fd58

Please sign in to comment.