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

@@ -57,7 +57,6 @@ type pageCommon struct {
// All of these represents the common parts of a page.Page
navigation.PageMenusProvider
page.AuthorProvider
page.AlternativeOutputFormatsProvider
page.ChildCareProvider
page.FileProvider

View File

@@ -32,7 +32,6 @@ import (
"github.com/gohugoio/hugo/common/constants"
"github.com/gohugoio/hugo/common/hashing"
"github.com/gohugoio/hugo/common/hugo"
"github.com/gohugoio/hugo/common/loggers"
"github.com/gohugoio/hugo/common/maps"
"github.com/gohugoio/hugo/common/paths"
@@ -108,23 +107,6 @@ func (p *pageMeta) Aliases() []string {
return p.pageConfig.Aliases
}
// Deprecated: Use taxonomies instead.
func (p *pageMeta) Author() page.Author {
hugo.Deprecate(".Page.Author", "Use taxonomies instead.", "v0.98.0")
authors := p.Authors()
for _, author := range authors {
return author
}
return page.Author{}
}
// Deprecated: Use taxonomies instead.
func (p *pageMeta) Authors() page.AuthorList {
hugo.Deprecate(".Page.Authors", "Use taxonomies instead.", "v0.112.0")
return nil
}
func (p *pageMeta) BundleType() string {
switch p.pathInfo.BundleType() {
case paths.PathTypeLeaf:

View File

@@ -183,7 +183,6 @@ func (h *HugoSites) doNewPage(m *pageMeta) (*pageState, *paths.Path, error) {
dependencyManager: m.s.Conf.NewIdentityManager(m.Path()),
pageCommon: &pageCommon{
FileProvider: m,
AuthorProvider: m,
store: maps.NewScratch(),
Positioner: page.NopPage,
InSectionPositioner: page.NopPage,

View File

@@ -17,7 +17,6 @@ import (
"context"
"errors"
"fmt"
"html/template"
"io"
"mime"
"net/url"
@@ -412,12 +411,6 @@ func newHugoSites(cfg deps.DepsCfg, d *deps.Deps, pageTrees *pageTrees, sites []
return h, nil
}
// Deprecated: Use hugo.IsServer instead.
func (s *Site) IsServer() bool {
hugo.Deprecate(".Site.IsServer", "Use hugo.IsServer instead.", "v0.120.0")
return s.conf.Internal.Running
}
// Returns the server port.
func (s *Site) ServerPort() int {
return s.conf.C.BaseURL.Port()
@@ -432,13 +425,6 @@ func (s *Site) Copyright() string {
return s.conf.Copyright
}
// Deprecated: Use .Site.Home.OutputFormats.Get "rss" instead.
func (s *Site) RSSLink() template.URL {
hugo.Deprecate(".Site.RSSLink", "Use the Output Format's Permalink method instead, e.g. .OutputFormats.Get \"RSS\".Permalink", "v0.114.0")
rssOutputFormat := s.home.OutputFormats().Get("rss")
return template.URL(rssOutputFormat.Permalink())
}
func (s *Site) Config() page.SiteConfig {
return page.SiteConfig{
Privacy: s.conf.Privacy,
@@ -520,18 +506,6 @@ func (s *Site) Social() map[string]string {
return s.conf.Social
}
// Deprecated: Use .Site.Config.Services.Disqus.Shortname instead.
func (s *Site) DisqusShortname() string {
hugo.Deprecate(".Site.DisqusShortname", "Use .Site.Config.Services.Disqus.Shortname instead.", "v0.120.0")
return s.Config().Services.Disqus.Shortname
}
// Deprecated: Use .Site.Config.Services.GoogleAnalytics.ID instead.
func (s *Site) GoogleAnalytics() string {
hugo.Deprecate(".Site.GoogleAnalytics", "Use .Site.Config.Services.GoogleAnalytics.ID instead.", "v0.120.0")
return s.Config().Services.GoogleAnalytics.ID
}
func (s *Site) Param(key any) (any, error) {
return resource.Param(s, nil, key)
}