shithub: hugo

Download patch

ref: 2f9b582dbe44af862e00348825c308a223d57407
parent: cb39f052d19dfbf1463b028e5173fc53d917cac1
author: elij <[email protected]>
date: Mon Aug 12 14:51:01 EDT 2013

fix wrong renderlist feed permalink

when not using ugly urls, the feed permalink does not end up in the
expected location, and instead always behaves as if using ugly urls.

this fixes that behavior and inserts the feed xml file into the
directory as index.xml.

fixes #32

--- a/hugolib/site.go
+++ b/hugolib/site.go
@@ -470,7 +470,11 @@
 
 		if a := s.Tmpl.Lookup("rss.xml"); a != nil {
 			// XML Feed
-			n.Url = Urlize(section + ".xml")
+            if s.Config.UglyUrls {
+                    n.Url = Urlize(section + ".xml")
+            } else {
+                    n.Url = Urlize(section + "/" + "index.xml")
+            }
 			n.Permalink = template.HTML(string(n.Site.BaseUrl) + n.Url)
 			y := s.NewXMLBuffer()
 			s.Tmpl.ExecuteTemplate(y, "rss.xml", n)