hugolib: Default rssLimit to unlimited
authorCameron Moore <moorereason@gmail.com>
Fri, 10 Mar 2017 00:41:59 +0000 (18:41 -0600)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Fri, 10 Mar 2017 20:27:45 +0000 (21:27 +0100)
Fixes #3145

hugolib/config.go
hugolib/site_render.go

index 2d0cfe8ee9a62b7ddb28dc031c79efa1bfdd15a7..f266d39553fa34b77179bf97137db0a60c124be9 100644 (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)
index 37ee21fd450db1d376f527e030132648c50a1358..9cc2f0eec0c12c58765f7972f2698858a3906756 100644 (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
        }