mirror of
https://github.com/gohugoio/hugo.git
synced 2025-03-20 10:44:20 +00:00
simplify rssuri logic
This commit is contained in:
parent
062f6c3383
commit
5c1204c24b
1 changed files with 6 additions and 4 deletions
|
@ -1125,11 +1125,12 @@ func taxonomyRenderer(s *Site, taxes <-chan taxRenderInfo, results chan<- error,
|
||||||
|
|
||||||
if !viper.GetBool("DisableRSS") {
|
if !viper.GetBool("DisableRSS") {
|
||||||
// XML Feed
|
// XML Feed
|
||||||
n.URL = s.permalinkStr(base + "/" + viper.GetString("RSSUri"))
|
rssuri := viper.GetString("RSSUri")
|
||||||
|
n.URL = s.permalinkStr(base + "/" + rssuri )
|
||||||
n.Permalink = s.permalink(base)
|
n.Permalink = s.permalink(base)
|
||||||
rssLayouts := []string{"taxonomy/" + t.singular + ".rss.xml", "_default/rss.xml", "rss.xml", "_internal/_default/rss.xml"}
|
rssLayouts := []string{"taxonomy/" + t.singular + ".rss.xml", "_default/rss.xml", "rss.xml", "_internal/_default/rss.xml"}
|
||||||
|
|
||||||
if err := s.renderAndWriteXML("taxonomy "+t.singular+" rss", base+"/"+viper.GetString("RSSUri"), n, s.appendThemeTemplates(rssLayouts)...); err != nil {
|
if err := s.renderAndWriteXML("taxonomy "+t.singular+" rss", base+"/"+rssuri, n, s.appendThemeTemplates(rssLayouts)...); err != nil {
|
||||||
results <- err
|
results <- err
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -1231,10 +1232,11 @@ func (s *Site) RenderSectionLists() error {
|
||||||
|
|
||||||
if !viper.GetBool("DisableRSS") && section != "" {
|
if !viper.GetBool("DisableRSS") && section != "" {
|
||||||
// XML Feed
|
// XML Feed
|
||||||
n.URL = s.permalinkStr(section + "/" + viper.GetString("RSSUri"))
|
rssuri := viper.GetString("RSSUri")
|
||||||
|
n.URL = s.permalinkStr(section + "/" + rssuri)
|
||||||
n.Permalink = s.permalink(section)
|
n.Permalink = s.permalink(section)
|
||||||
rssLayouts := []string{"section/" + section + ".rss.xml", "_default/rss.xml", "rss.xml", "_internal/_default/rss.xml"}
|
rssLayouts := []string{"section/" + section + ".rss.xml", "_default/rss.xml", "rss.xml", "_internal/_default/rss.xml"}
|
||||||
if err := s.renderAndWriteXML("section "+section+" rss", section+"/"+viper.GetString("RSSUri"), n, s.appendThemeTemplates(rssLayouts)...); err != nil {
|
if err := s.renderAndWriteXML("section "+section+" rss", section+"/"+rssuri, n, s.appendThemeTemplates(rssLayouts)...); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue