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()
}
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
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
}