mirror of
https://github.com/gohugoio/hugo.git
synced 2024-05-11 05:54:58 +00:00
Adding support for recent content.
This commit is contained in:
@ -206,7 +206,12 @@ func (s *Site) initialize() {
|
|||||||
|
|
||||||
filepath.Walk(s.Config.GetAbsPath(s.Config.ContentDir), walker)
|
filepath.Walk(s.Config.GetAbsPath(s.Config.ContentDir), walker)
|
||||||
|
|
||||||
s.Info = SiteInfo{BaseUrl: template.URL(s.Config.BaseUrl), Title: s.Config.Title, Config: &s.Config}
|
s.Info = SiteInfo{
|
||||||
|
BaseUrl: template.URL(s.Config.BaseUrl),
|
||||||
|
Title: s.Config.Title,
|
||||||
|
Recent: &s.Pages,
|
||||||
|
Config: &s.Config,
|
||||||
|
}
|
||||||
|
|
||||||
s.Shortcodes = make(map[string]ShortcodeFunc)
|
s.Shortcodes = make(map[string]ShortcodeFunc)
|
||||||
}
|
}
|
||||||
@ -471,9 +476,9 @@ func (s *Site) RenderLists() error {
|
|||||||
if a := s.Tmpl.Lookup("rss.xml"); a != nil {
|
if a := s.Tmpl.Lookup("rss.xml"); a != nil {
|
||||||
// XML Feed
|
// XML Feed
|
||||||
if s.Config.UglyUrls {
|
if s.Config.UglyUrls {
|
||||||
n.Url = Urlize(section + ".xml")
|
n.Url = Urlize(section + ".xml")
|
||||||
} else {
|
} else {
|
||||||
n.Url = Urlize(section + "/" + "index.xml")
|
n.Url = Urlize(section + "/" + "index.xml")
|
||||||
}
|
}
|
||||||
n.Permalink = template.HTML(string(n.Site.BaseUrl) + n.Url)
|
n.Permalink = template.HTML(string(n.Site.BaseUrl) + n.Url)
|
||||||
y := s.NewXMLBuffer()
|
y := s.NewXMLBuffer()
|
||||||
|
Reference in New Issue
Block a user