From 6a3d1037b31706f69d23b46d4c80bafc33f9759d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Fri, 28 Oct 2016 14:46:33 +0200 Subject: [PATCH] Fix RSS Title regression And add tests to make sure it doesn't happen again. Fixes #2645 --- hugolib/rss_test.go | 35 +++++++++-------------------------- hugolib/site.go | 2 ++ hugolib/site_test.go | 1 + 3 files changed, 12 insertions(+), 26 deletions(-) diff --git a/hugolib/rss_test.go b/hugolib/rss_test.go index 2bf849f9e0e..966b00af007 100644 --- a/hugolib/rss_test.go +++ b/hugolib/rss_test.go @@ -20,44 +20,27 @@ import ( "github.com/spf13/viper" ) -const rssTemplate = ` - - {{ .Title }} on {{ .Site.Title }} - {{ .Permalink }} - en-us - Steve Francia - Francia; all rights reserved. - {{ .Date }} - {{ range .Data.Pages }} - - {{ .Title }} - {{ .Permalink }} - {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 MST" }} - Steve Francia - {{ .Permalink }} - {{ .Content | html }} - - {{ end }} - -` - func TestRSSOutput(t *testing.T) { testCommonResetState() - rssURI := "public/customrss.xml" + rssURI := "customrss.xml" viper.Set("baseURL", "http://auth/bub/") viper.Set("rssURI", rssURI) + viper.Set("title", "RSSTest") for _, s := range weightedSources { - writeSource(t, filepath.Join("content", s.Name), string(s.Content)) + writeSource(t, filepath.Join("content", "sect", s.Name), string(s.Content)) } - writeSource(t, filepath.Join("layouts", "rss.xml"), rssTemplate) - if err := buildAndRenderSite(newSiteDefaultLang()); err != nil { t.Fatalf("Failed to build site: %s", err) } - assertFileContent(t, filepath.Join("public", rssURI), true, "