From 95808724595ab97042c204f3d92ea5c2929a8241 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Fri, 7 Apr 2017 10:48:09 +0200 Subject: [PATCH] hugolib: Update deprecation vs Hugo 0.20 Fixes #3271 --- hugolib/page.go | 9 +-------- hugolib/site.go | 27 --------------------------- 2 files changed, 1 insertion(+), 35 deletions(-) diff --git a/hugolib/page.go b/hugolib/page.go index 00646d27d..259b2fb92 100644 --- a/hugolib/page.go +++ b/hugolib/page.go @@ -1507,7 +1507,7 @@ func (p *Page) copy() *Page { func (p *Page) Now() time.Time { // Delete in Hugo 0.21 - helpers.Deprecated("Page", "Now", "Use now (the template func)", false) + helpers.Deprecated("Page", "Now", "Use now (the template func)", true) return time.Now() } @@ -1515,13 +1515,6 @@ func (p *Page) Hugo() *HugoInfo { return hugoInfo } -func (p *Page) RSSlink() template.URL { - // TODO(bep) we cannot have two of these - // Remove in Hugo 0.20 - helpers.Deprecated(".Page", "RSSlink", "Use RSSLink", true) - return p.RSSLink() -} - func (p *Page) Ref(refs ...string) (string, error) { if len(refs) == 0 { return "", nil diff --git a/hugolib/site.go b/hugolib/site.go index ec3e1a4bd..345085ef7 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -376,33 +376,6 @@ func (s *SiteInfo) Param(key interface{}) (interface{}, error) { return s.Params[keyStr], nil } -// GetParam gets a site parameter value if found, nil if not. -func (s *SiteInfo) GetParam(key string) interface{} { - // Remove in Hugo 0.20 - helpers.Deprecated("SiteInfo", ".GetParam", "Use .Param", true) - v := s.Params[strings.ToLower(key)] - - if v == nil { - return nil - } - - switch val := v.(type) { - case bool: - return val - case string: - return val - case int64, int32, int16, int8, int: - return cast.ToInt(v) - case float64, float32: - return cast.ToFloat64(v) - case time.Time: - return val - case []string: - return v - } - return nil -} - func (s *SiteInfo) IsMultiLingual() bool { return len(s.Languages) > 1 }