mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-28 06:30:33 +03:00
hugolib, layout: Consolidate RSS template handling
This commit is contained in:
parent
ee75e2999b
commit
3cd97951f1
6 changed files with 71 additions and 48 deletions
|
@ -173,13 +173,6 @@ func (s *Site) renderRSS(p *PageOutput) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
layouts := p.rssLayouts()
|
||||
|
||||
if layouts == nil {
|
||||
// No RSS for this Kind of page.
|
||||
return nil
|
||||
}
|
||||
|
||||
p.Kind = kindRSS
|
||||
|
||||
// TODO(bep) we zero the date here to get the number of diffs down in
|
||||
|
@ -196,6 +189,11 @@ func (s *Site) renderRSS(p *PageOutput) error {
|
|||
p.Data["Pages"] = p.Pages
|
||||
}
|
||||
|
||||
layouts := s.layoutHandler.For(
|
||||
p.layoutDescriptor,
|
||||
"",
|
||||
p.outputFormat)
|
||||
|
||||
// TODO(bep) output deprecate/handle rssURI
|
||||
targetPath, err := p.targetPath()
|
||||
if err != nil {
|
||||
|
@ -203,7 +201,7 @@ func (s *Site) renderRSS(p *PageOutput) error {
|
|||
}
|
||||
|
||||
return s.renderAndWriteXML(p.Title,
|
||||
targetPath, p, s.appendThemeTemplates(layouts)...)
|
||||
targetPath, p, layouts...)
|
||||
}
|
||||
|
||||
func (s *Site) render404() error {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue