mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
Homepage now has all content available, use sorting and first to control rendering
This commit is contained in:
parent
13fa7cb748
commit
ad2c0b5616
1 changed files with 1 additions and 9 deletions
|
@ -501,20 +501,12 @@ func (s *Site) RenderLists() error {
|
|||
}
|
||||
|
||||
func (s *Site) RenderHomePage() error {
|
||||
|
||||
n := s.NewNode()
|
||||
n.Title = n.Site.Title
|
||||
n.Url = helpers.Urlize(string(n.Site.BaseUrl))
|
||||
n.RSSlink = permalink(s, "index.xml")
|
||||
n.Permalink = permalink(s, "")
|
||||
if len(s.Pages) > 0 {
|
||||
n.Date = s.Pages[0].Date
|
||||
if len(s.Pages) < 9 {
|
||||
n.Data["Pages"] = s.Pages
|
||||
} else {
|
||||
n.Data["Pages"] = s.Pages[:9]
|
||||
}
|
||||
}
|
||||
n.Data["Pages"] = s.Pages
|
||||
err := s.render(n, "/", "index.html")
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in a new issue