hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit 95808724595ab97042c204f3d92ea5c2929a8241
parent af99a59021cc1231d5afa79f4ab17d34f39260fc
Author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Date:   Fri,  7 Apr 2017 10:48:09 +0200

hugolib: Update deprecation vs Hugo 0.20

Fixes #3271

Diffstat:
Mhugolib/page.go | 9+--------
Mhugolib/site.go | 27---------------------------
2 files changed, 1 insertion(+), 35 deletions(-)
diff --git 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
@@ -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
 }