From 2f9b582dbe44af862e00348825c308a223d57407 Mon Sep 17 00:00:00 2001 From: elij Date: Mon, 12 Aug 2013 18:51:01 -0700 Subject: [PATCH 1/2] 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 --- hugolib/site.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hugolib/site.go b/hugolib/site.go index 105034878..08a0e54b4 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -470,7 +470,11 @@ func (s *Site) RenderLists() error { 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) From 023567b05e1542cbdd25514f2ba7dd15a6e3a6c8 Mon Sep 17 00:00:00 2001 From: elij Date: Mon, 12 Aug 2013 19:01:23 -0700 Subject: [PATCH 2/2] fix bad tab/space due to paste --- hugolib/site.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hugolib/site.go b/hugolib/site.go index 08a0e54b4..6e2a933c3 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -470,11 +470,11 @@ func (s *Site) RenderLists() error { if a := s.Tmpl.Lookup("rss.xml"); a != nil { // XML Feed - if s.Config.UglyUrls { - n.Url = Urlize(section + ".xml") - } else { - n.Url = Urlize(section + "/" + "index.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)