diff options
Diffstat (limited to 'hugolib')
-rw-r--r-- | hugolib/hugo_sites_build.go | 7 | ||||
-rw-r--r-- | hugolib/page__meta.go | 6 | ||||
-rw-r--r-- | hugolib/site_new.go | 14 |
3 files changed, 8 insertions, 19 deletions
diff --git a/hugolib/hugo_sites_build.go b/hugolib/hugo_sites_build.go index 27fde5822..72b5fe771 100644 --- a/hugolib/hugo_sites_build.go +++ b/hugolib/hugo_sites_build.go @@ -25,7 +25,6 @@ import ( "github.com/bep/logg" "github.com/gohugoio/hugo/hugofs/files" - "github.com/gohugoio/hugo/langs" "github.com/gohugoio/hugo/publisher" "github.com/gohugoio/hugo/tpl" @@ -40,14 +39,8 @@ import ( "github.com/gohugoio/hugo/output" "github.com/fsnotify/fsnotify" - "github.com/gohugoio/hugo/helpers" ) -func init() { - // To avoid circular dependencies, we set this here. - langs.DeprecationFunc = helpers.Deprecated -} - // Build builds all sites. If filesystem events are provided, // this is considered to be a potential partial rebuild. func (h *HugoSites) Build(config BuildCfg, events ...fsnotify.Event) error { diff --git a/hugolib/page__meta.go b/hugolib/page__meta.go index 1c4f13d3b..0dd236904 100644 --- a/hugolib/page__meta.go +++ b/hugolib/page__meta.go @@ -130,7 +130,7 @@ func (p *pageMeta) Aliases() []string { } func (p *pageMeta) Author() page.Author { - helpers.Deprecated(".Author", "Use taxonomies.", false) + hugo.Deprecate(".Author", "Use taxonomies.", "v0.98.0") authors := p.Authors() for _, author := range authors { @@ -140,7 +140,7 @@ func (p *pageMeta) Author() page.Author { } func (p *pageMeta) Authors() page.AuthorList { - helpers.Deprecated(".Authors", "Use taxonomies.", true) + hugo.Deprecate(".Author", "Use taxonomies.", "v0.112.0") return nil } @@ -226,7 +226,7 @@ func (p *pageMeta) Path() string { {{ $path = .Path }} {{ end }} ` - helpers.Deprecated(".Path when the page is backed by a file", "We plan to use Path for a canonical source path and you probably want to check the source is a file. To get the current behaviour, you can use a construct similar to the one below:\n"+example, false) + p.s.Log.Warnln(".Path when the page is backed by a file is deprecated. We plan to use Path for a canonical source path and you probably want to check the source is a file. To get the current behaviour, you can use a construct similar to the one below:\n" + example) } diff --git a/hugolib/site_new.go b/hugolib/site_new.go index b35de79ef..127b0e296 100644 --- a/hugolib/site_new.go +++ b/hugolib/site_new.go @@ -31,7 +31,6 @@ import ( "github.com/gohugoio/hugo/config" "github.com/gohugoio/hugo/config/allconfig" "github.com/gohugoio/hugo/deps" - "github.com/gohugoio/hugo/helpers" "github.com/gohugoio/hugo/identity" "github.com/gohugoio/hugo/langs" "github.com/gohugoio/hugo/langs/i18n" @@ -48,9 +47,7 @@ import ( "github.com/gohugoio/hugo/tpl/tplimpl" ) -var ( - _ page.Site = (*Site)(nil) -) +var _ page.Site = (*Site)(nil) type Site struct { conf *allconfig.Config @@ -236,7 +233,6 @@ func NewHugoSites(cfg deps.DepsCfg) (*HugoSites, error) { } return h, err - } func newHugoSitesNew(cfg deps.DepsCfg, d *deps.Deps, sites []*Site) (*HugoSites, error) { @@ -358,7 +354,7 @@ func newHugoSitesNew(cfg deps.DepsCfg, d *deps.Deps, sites []*Site) (*HugoSites, // Returns true if we're running in a server. // Deprecated: use hugo.IsServer instead func (s *Site) IsServer() bool { - helpers.Deprecated(".Site.IsServer", "Use hugo.IsServer instead.", false) + hugo.Deprecate(".Site.IsServer", "Use hugo.IsServer instead.", "v0.120.0") return s.conf.Internal.Running } @@ -377,7 +373,7 @@ func (s *Site) Copyright() string { } func (s *Site) RSSLink() template.URL { - helpers.Deprecated("Site.RSSLink", "Use the Output Format's Permalink method instead, e.g. .OutputFormats.Get \"RSS\".Permalink", false) + 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()) } @@ -449,13 +445,13 @@ func (s *Site) Social() map[string]string { // Deprecated: Use .Site.Config.Services.Disqus.Shortname instead func (s *Site) DisqusShortname() string { - helpers.Deprecated(".Site.DisqusShortname", "Use .Site.Config.Services.Disqus.Shortname instead.", false) + 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 { - helpers.Deprecated(".Site.GoogleAnalytics", "Use .Site.Config.Services.GoogleAnalytics.ID instead.", false) + hugo.Deprecate(".Site.GoogleAnalytics", "Use .Site.Config.Services.GoogleAnalytics.ID instead.", "v0.120.0") return s.Config().Services.GoogleAnalytics.ID } |