1
0
Fork 0
mirror of https://github.com/gohugoio/hugo.git synced 2025-04-19 06:34:06 +00:00

Check for the presence of pages before setting dates

See 
This commit is contained in:
Bjørn Erik Pedersen 2016-02-27 23:25:41 +01:00
parent 75cf324322
commit 804603155f

View file

@ -1711,8 +1711,10 @@ func (s *Site) newHomeNode() *Node {
n.IsHome = true
s.setURLs(n, "/")
n.Data["Pages"] = s.Pages
n.Date = s.Pages[0].Date
n.Lastmod = s.Pages[0].Lastmod
if len(s.Pages) != 0 {
n.Date = s.Pages[0].Date
n.Lastmod = s.Pages[0].Lastmod
}
return n
}