shithub: hugo

Download patch

ref: cb0405338568055fcfe3440ad539c5d3aebc6486
parent: 303be735fb01c76d370046ca74cf4dd3a604082b
author: spf13 <[email protected]>
date: Sat Jan 18 06:02:27 EST 2014

RSS improvements, now limit to 15 items and provide accurate date. fixed #172

--- a/hugolib/site.go
+++ b/hugolib/site.go
@@ -519,6 +519,14 @@
 		n.Url = helpers.Urlize("index.xml")
 		n.Title = "Recent Content"
 		n.Permalink = permalink(s, "index.xml")
+        high := 15
+        if len(s.Pages) < high {
+            high = len(s.Pages)
+        }
+        n.Data["Pages"] = s.Pages[:high]
+        if len(s.Pages) > 0 {
+            n.Date = s.Pages[0].Date
+        }
 		err := s.render(n, ".xml", "rss.xml")
 		if err != nil {
 			return err