mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-14 20:37:55 -05:00
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.
This commit is contained in:
parent
41cc4e4ba3
commit
097fd588ca
2 changed files with 5 additions and 0 deletions
|
@ -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{}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue