mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-26 13:40:38 +03:00
all: Deprecate .Page.Lang and .Page.File.Lang
Use .Page.Language.Lang instead.
This commit is contained in:
parent
d8f0e30715
commit
963cecc12c
2 changed files with 7 additions and 1 deletions
|
@ -105,6 +105,7 @@ func (p *pageMeta) Aliases() []string {
|
||||||
return p.pageConfig.Aliases
|
return p.pageConfig.Aliases
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Deprecated: use taxonomies.
|
||||||
func (p *pageMeta) Author() page.Author {
|
func (p *pageMeta) Author() page.Author {
|
||||||
hugo.Deprecate(".Author", "Use taxonomies.", "v0.98.0")
|
hugo.Deprecate(".Author", "Use taxonomies.", "v0.98.0")
|
||||||
authors := p.Authors()
|
authors := p.Authors()
|
||||||
|
@ -115,6 +116,7 @@ func (p *pageMeta) Author() page.Author {
|
||||||
return page.Author{}
|
return page.Author{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Deprecated: use taxonomies.
|
||||||
func (p *pageMeta) Authors() page.AuthorList {
|
func (p *pageMeta) Authors() page.AuthorList {
|
||||||
hugo.Deprecate(".Author", "Use taxonomies.", "v0.112.0")
|
hugo.Deprecate(".Author", "Use taxonomies.", "v0.112.0")
|
||||||
return nil
|
return nil
|
||||||
|
@ -151,7 +153,9 @@ func (p *pageMeta) Description() string {
|
||||||
return p.pageConfig.Description
|
return p.pageConfig.Description
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Deprecated: use .Page.Language.Lang instead.
|
||||||
func (p *pageMeta) Lang() string {
|
func (p *pageMeta) Lang() string {
|
||||||
|
hugo.Deprecate(".Page.Lang", "Use .Page.Language.Lang instead.", "v0.123.0")
|
||||||
return p.s.Lang()
|
return p.s.Lang()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,17 +51,19 @@ func (fi *File) Dir() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extension is an alias to Ext().
|
// Extension is an alias to Ext().
|
||||||
|
// Deprecated: Use Ext() instead.
|
||||||
func (fi *File) Extension() string {
|
func (fi *File) Extension() string {
|
||||||
hugo.Deprecate(".File.Extension", "Use .File.Ext instead.", "v0.96.0")
|
hugo.Deprecate(".File.Extension", "Use .File.Ext instead.", "v0.96.0")
|
||||||
return fi.Ext()
|
return fi.Ext()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ext returns a file's extension without the leading period (e.g. "md").
|
// Ext returns a file's extension without the leading period (e.g. "md").
|
||||||
// Deprecated: Use Extension() instead.
|
|
||||||
func (fi *File) Ext() string { return fi.p().Ext() }
|
func (fi *File) Ext() string { return fi.p().Ext() }
|
||||||
|
|
||||||
// Lang returns a file's language (e.g. "sv").
|
// Lang returns a file's language (e.g. "sv").
|
||||||
|
// Deprecated: use .Page.Language.Lang instead.
|
||||||
func (fi *File) Lang() string {
|
func (fi *File) Lang() string {
|
||||||
|
hugo.Deprecate(".Page.File.Lang", "Use .Page.Language.Lang instead.", "v0.123.0")
|
||||||
return fi.fim.Meta().Lang
|
return fi.fim.Meta().Lang
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue