mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-29 10:02:12 -05:00
parent
af99a59021
commit
9580872459
2 changed files with 1 additions and 35 deletions
|
@ -1507,7 +1507,7 @@ func (p *Page) copy() *Page {
|
||||||
|
|
||||||
func (p *Page) Now() time.Time {
|
func (p *Page) Now() time.Time {
|
||||||
// Delete in Hugo 0.21
|
// 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 time.Now()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1515,13 +1515,6 @@ func (p *Page) Hugo() *HugoInfo {
|
||||||
return 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) {
|
func (p *Page) Ref(refs ...string) (string, error) {
|
||||||
if len(refs) == 0 {
|
if len(refs) == 0 {
|
||||||
return "", nil
|
return "", nil
|
||||||
|
|
|
@ -376,33 +376,6 @@ func (s *SiteInfo) Param(key interface{}) (interface{}, error) {
|
||||||
return s.Params[keyStr], 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 {
|
func (s *SiteInfo) IsMultiLingual() bool {
|
||||||
return len(s.Languages) > 1
|
return len(s.Languages) > 1
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue