diff options
author | Joe Mooring <[email protected]> | 2024-03-09 11:21:46 -0800 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2024-03-10 10:47:51 +0200 |
commit | 4f92f949eaf8c9827a758b3caadc672e0335480b (patch) | |
tree | b3e43a708cc4703697c4108d7c1798345874da8f /hugolib | |
parent | d24ffdde5b34cb848d04db7099f9bf8903099209 (diff) | |
download | hugo-4f92f949eaf8c9827a758b3caadc672e0335480b.tar.gz hugo-4f92f949eaf8c9827a758b3caadc672e0335480b.zip |
hugolib: Deprecate .Site.MultiLingual in favor of hugo.IsMultiLingual
Closes #12224
Diffstat (limited to 'hugolib')
-rw-r--r-- | hugolib/page_test.go | 4 | ||||
-rw-r--r-- | hugolib/site_new.go | 16 |
2 files changed, 11 insertions, 9 deletions
diff --git a/hugolib/page_test.go b/hugolib/page_test.go index 9a904ee46..b6236ca5f 100644 --- a/hugolib/page_test.go +++ b/hugolib/page_test.go @@ -578,7 +578,7 @@ date: 2012-01-12 b.Assert(s.getPageOldVersion("/with-index-no-date").Date().IsZero(), qt.Equals, true) checkDate(s.getPageOldVersion("/with-index-date"), 2018) - b.Assert(s.Site().LastChange().Year(), qt.Equals, 2018) + b.Assert(s.Site().Lastmod().Year(), qt.Equals, 2018) } func TestCreateNewPage(t *testing.T) { @@ -773,7 +773,7 @@ func TestSummaryManualSplit(t *testing.T) { title: Simple --- This is **summary**. -<!--more--> +<!--more--> This is **content**. -- layouts/_default/single.html -- Summary: {{ .Summary }}|Truncated: {{ .Truncated }}| diff --git a/hugolib/site_new.go b/hugolib/site_new.go index 3bcc307ad..5a5811958 100644 --- a/hugolib/site_new.go +++ b/hugolib/site_new.go @@ -361,8 +361,7 @@ func newHugoSites(cfg deps.DepsCfg, d *deps.Deps, pageTrees *pageTrees, sites [] return h, nil } -// Returns true if we're running in a server. -// Deprecated: use hugo.IsServer instead +// 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 @@ -382,8 +381,9 @@ 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") + 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()) } @@ -431,9 +431,9 @@ func (s *Site) BaseURL() string { return s.conf.C.BaseURL.WithPath } -// Returns the last modification date of the content. -// Deprecated: Use .Lastmod instead. +// Deprecated: Use .Site.Lastmod instead. func (s *Site) LastChange() time.Time { + hugo.Deprecate(".Site.LastChange", "Use .Site.Lastmod instead.", "v0.123.0") return s.lastmod } @@ -459,13 +459,13 @@ func (s *Site) Social() map[string]string { return s.conf.Social } -// Deprecated: Use .Site.Config.Services.Disqus.Shortname instead +// 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 +// 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 @@ -484,7 +484,9 @@ func (s *Site) BuildDrafts() bool { return s.conf.BuildDrafts } +// Deprecated: Use hugo.IsMultiLingual instead. func (s *Site) IsMultiLingual() bool { + hugo.Deprecate(".Site.IsMultiLingual", "Use hugo.IsMultiLingual instead.", "v0.124.0") return s.h.isMultiLingual() } |