projects
/
brevno-suite
/
hugo
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
303be73
)
RSS improvements, now limit to 15 items and provide accurate date. fixed #172
author
spf13
<steve.francia@gmail.com>
Sat, 18 Jan 2014 16:02:27 +0000
(11:02 -0500)
committer
spf13
<steve.francia@gmail.com>
Sat, 18 Jan 2014 16:05:50 +0000
(11:05 -0500)
hugolib/site.go
patch
|
blob
|
history
diff --git
a/hugolib/site.go
b/hugolib/site.go
index 3fd5b3d58872ef834f3315248360b744f6fe9a39..313537f80ce48218a140797896ae3be2e579e52a 100644
(file)
--- a/
hugolib/site.go
+++ b/
hugolib/site.go
@@
-519,6
+519,14
@@
func (s *Site) RenderHomePage() error {
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