mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
hugolib: Remove the copying in the renderRSS
This commit is contained in:
parent
a8244658f7
commit
e5200ddaa4
1 changed files with 9 additions and 10 deletions
|
@ -163,29 +163,28 @@ func (s *Site) renderRSS(p *PageOutput) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
rssPage := p // p.copy() TODO(bep) output
|
p.Kind = kindRSS
|
||||||
rssPage.Kind = kindRSS
|
|
||||||
|
|
||||||
// TODO(bep) we zero the date here to get the number of diffs down in
|
// TODO(bep) we zero the date here to get the number of diffs down in
|
||||||
// testing. But this should be set back later; the RSS feed should
|
// testing. But this should be set back later; the RSS feed should
|
||||||
// inherit the publish date from the node it represents.
|
// inherit the publish date from the node it represents.
|
||||||
if p.Kind == KindTaxonomy {
|
if p.Kind == KindTaxonomy {
|
||||||
var zeroDate time.Time
|
var zeroDate time.Time
|
||||||
rssPage.Date = zeroDate
|
p.Date = zeroDate
|
||||||
}
|
}
|
||||||
|
|
||||||
limit := s.Cfg.GetInt("rssLimit")
|
limit := s.Cfg.GetInt("rssLimit")
|
||||||
if limit >= 0 && len(rssPage.Pages) > limit {
|
if limit >= 0 && len(p.Pages) > limit {
|
||||||
rssPage.Pages = rssPage.Pages[:limit]
|
p.Pages = p.Pages[:limit]
|
||||||
rssPage.Data["Pages"] = rssPage.Pages
|
p.Data["Pages"] = p.Pages
|
||||||
}
|
}
|
||||||
rssURI := s.Language.GetString("rssURI")
|
rssURI := s.Language.GetString("rssURI")
|
||||||
|
|
||||||
rssPath := path.Join(append(rssPage.sections, rssURI)...)
|
rssPath := path.Join(append(p.sections, rssURI)...)
|
||||||
s.setPageURLs(rssPage.Page, rssPath)
|
s.setPageURLs(p.Page, rssPath)
|
||||||
|
|
||||||
return s.renderAndWriteXML(rssPage.Title,
|
return s.renderAndWriteXML(p.Title,
|
||||||
rssPage.addLangFilepathPrefix(rssPath), rssPage, s.appendThemeTemplates(layouts)...)
|
p.addLangFilepathPrefix(rssPath), p, s.appendThemeTemplates(layouts)...)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Site) render404() error {
|
func (s *Site) render404() error {
|
||||||
|
|
Loading…
Reference in a new issue