Remove deprecations <= v0.122.0 (note)

These have, once we release this, been logging ERROR for 6 minor versions.
This commit is contained in:
Bjørn Erik Pedersen
2024-11-16 17:58:06 +01:00
parent f7fc6ccd59
commit ad43d137d5
16 changed files with 7 additions and 287 deletions

View File

@@ -51,14 +51,6 @@ type AlternativeOutputFormatsProvider interface {
AlternativeOutputFormats() OutputFormats
}
// AuthorProvider provides author information.
type AuthorProvider interface {
// Deprecated: Use taxonomies instead.
Author() Author
// Deprecated: Use taxonomies instead.
Authors() AuthorList
}
// ChildCareProvider provides accessors to child resources.
type ChildCareProvider interface {
// Pages returns a list of pages of all kinds.
@@ -309,9 +301,6 @@ type PageWithoutContent interface {
Positioner
navigation.PageMenusProvider
// TODO(bep)
AuthorProvider
// Page lookups/refs
GetPageProvider
RefProvider

View File

@@ -77,20 +77,6 @@ func (p *nopPage) Layout() string {
return ""
}
func (p *nopPage) RSSLink() template.URL {
return ""
}
// Deprecated: Use taxonomies instead.
func (p *nopPage) Author() Author {
return Author{}
}
// Deprecated: Use taxonomies instead.
func (p *nopPage) Authors() AuthorList {
return nil
}
func (p *nopPage) AllTranslations() Pages {
return nil
}
@@ -167,14 +153,6 @@ func (p *nopPage) ExpiryDate() (t time.Time) {
return
}
func (p *nopPage) Ext() string {
return ""
}
func (p *nopPage) Extension() string {
return ""
}
func (p *nopPage) File() *source.File {
return nil
}

View File

@@ -14,7 +14,6 @@
package page
import (
"html/template"
"time"
"github.com/gohugoio/hugo/common/maps"
@@ -54,9 +53,6 @@ type Site interface {
// A shortcut to the home
Home() Page
// Deprecated: Use hugo.IsServer instead.
IsServer() bool
// Returns the server port.
ServerPort() int
@@ -117,12 +113,6 @@ type Site interface {
// Deprecated: Use .Site.Params instead.
Social() map[string]string
// Deprecated: Use Config().Services.GoogleAnalytics instead.
GoogleAnalytics() string
// Deprecated: Use Config().Privacy.Disqus instead.
DisqusShortname() string
// BuildDrafts is deprecated and will be removed in a future release.
BuildDrafts() bool
@@ -132,9 +122,6 @@ type Site interface {
// LanguagePrefix returns the language prefix for this site.
LanguagePrefix() string
// Deprecated: Use .Site.Home.OutputFormats.Get "rss" instead.
RSSLink() template.URL
maps.StoreProvider
// For internal use only.
@@ -195,11 +182,6 @@ func (s *siteWrapper) Authors() AuthorList {
return s.s.Authors()
}
// Deprecated: Use .Site.Config.Services.GoogleAnalytics.ID instead.
func (s *siteWrapper) GoogleAnalytics() string {
return s.s.GoogleAnalytics()
}
func (s *siteWrapper) GetPage(ref ...string) (Page, error) {
return s.s.GetPage(ref...)
}
@@ -232,11 +214,6 @@ func (s *siteWrapper) Home() Page {
return s.s.Home()
}
// Deprecated: Use hugo.IsServer instead.
func (s *siteWrapper) IsServer() bool {
return s.s.IsServer()
}
func (s *siteWrapper) ServerPort() int {
return s.s.ServerPort()
}
@@ -315,20 +292,10 @@ func (s *siteWrapper) IsMultiLingual() bool {
return s.s.IsMultiLingual()
}
// Deprecated: Use .Site.Config.Services.Disqus.Shortname instead.
func (s *siteWrapper) DisqusShortname() string {
return s.s.DisqusShortname()
}
func (s *siteWrapper) LanguagePrefix() string {
return s.s.LanguagePrefix()
}
// Deprecated: Use .Site.Home.OutputFormats.Get "rss" instead.
func (s *siteWrapper) RSSLink() template.URL {
return s.s.RSSLink()
}
func (s *siteWrapper) Store() *maps.Scratch {
return s.s.Store()
}
@@ -416,20 +383,10 @@ func (t testSite) Languages() langs.Languages {
return nil
}
// Deprecated: Use .Site.Config.Services.GoogleAnalytics.ID instead.
func (t testSite) GoogleAnalytics() string {
return ""
}
func (t testSite) MainSections() []string {
return nil
}
// Deprecated: Use hugo.IsServer instead.
func (t testSite) IsServer() bool {
return false
}
func (t testSite) Language() *langs.Language {
return t.l
}
@@ -474,11 +431,6 @@ func (s testSite) Config() SiteConfig {
return SiteConfig{}
}
// Deprecated: Use .Site.Config.Services.Disqus.Shortname instead.
func (testSite) DisqusShortname() string {
return ""
}
func (s testSite) BuildDrafts() bool {
return false
}
@@ -492,11 +444,6 @@ func (s testSite) Param(key any) (any, error) {
return nil, nil
}
// Deprecated: Use .Site.Home.OutputFormats.Get "rss" instead.
func (s testSite) RSSLink() template.URL {
return ""
}
func (s testSite) Store() *maps.Scratch {
return maps.NewScratch()
}

View File

@@ -127,16 +127,6 @@ func (p *testPage) AlternativeOutputFormats() OutputFormats {
panic("testpage: not implemented")
}
// Deprecated: Use taxonomies instead.
func (p *testPage) Author() Author {
return Author{}
}
// Deprecated: Use taxonomies instead.
func (p *testPage) Authors() AuthorList {
return nil
}
func (p *testPage) BaseFileName() string {
panic("testpage: not implemented")
}
@@ -201,14 +191,6 @@ func (p *testPage) ExpiryDate() time.Time {
return p.expiryDate
}
func (p *testPage) Ext() string {
panic("testpage: not implemented")
}
func (p *testPage) Extension() string {
panic("testpage: not implemented")
}
func (p *testPage) File() *source.File {
return p.file
}
@@ -459,10 +441,6 @@ func (p *testPage) PublishDate() time.Time {
return p.pubDate
}
func (p *testPage) RSSLink() template.URL {
return ""
}
func (p *testPage) RawContent() string {
panic("testpage: not implemented")
}