hugolib: Default rssLimit to unlimited

Fixes #3145
This commit is contained in:
Cameron Moore 2017-03-09 18:41:59 -06:00 committed by Bjørn Erik Pedersen
parent 48120ccfd2
commit fe41bd61bb
2 changed files with 2 additions and 2 deletions

View file

@ -102,7 +102,7 @@ func loadDefaultSettingsFor(v *viper.Viper) {
v.SetDefault("paginatePath", "page")
v.SetDefault("blackfriday", c.NewBlackfriday())
v.SetDefault("rSSUri", "index.xml")
v.SetDefault("rssLimit", 15)
v.SetDefault("rssLimit", -1)
v.SetDefault("sectionPagesMenu", "")
v.SetDefault("disablePathToLower", false)
v.SetDefault("hasCJKLanguage", false)

View file

@ -157,7 +157,7 @@ func (s *Site) renderRSS(p *Page) error {
}
limit := s.Cfg.GetInt("rssLimit")
if len(rssPage.Pages) > limit {
if limit >= 0 && len(rssPage.Pages) > limit {
rssPage.Pages = rssPage.Pages[:limit]
rssPage.Data["Pages"] = rssPage.Pages
}