From 5f42590144579c318a444ea2ce46d5c3fbbbfe6e Mon Sep 17 00:00:00 2001 From: Kyle Anderson Date: Tue, 11 Aug 2020 22:34:04 -0700 Subject: [PATCH] Remove trailing whitespace and tabs from RSS templates The rss templates had some tab characters mixed in with the spaces. Additionally there would end up being trailing whitespace in output rss feeds, which looks red in git diff. --- tpl/tplimpl/embedded/templates.autogen.go | 28 ++++++++++--------- .../embedded/templates/_default/rss.xml | 8 +++--- .../embedded/templates/_default/sitemap.xml | 2 +- .../templates/_default/sitemapindex.xml | 16 +++++------ 4 files changed, 28 insertions(+), 26 deletions(-) diff --git a/tpl/tplimpl/embedded/templates.autogen.go b/tpl/tplimpl/embedded/templates.autogen.go index 190c88e3..6a684493 100644 --- a/tpl/tplimpl/embedded/templates.autogen.go +++ b/tpl/tplimpl/embedded/templates.autogen.go @@ -43,9 +43,9 @@ var EmbeddedTemplates = [][2]string{ {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }} {{.}}{{end}}{{ if not .Date.IsZero }} {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} - {{ with .OutputFormats.Get "RSS" }} - {{ printf "" .Permalink .MediaType | safeHTML }} - {{ end }} + {{- with .OutputFormats.Get "RSS" -}} + {{ printf "" .Permalink .MediaType | safeHTML }} + {{- end -}} {{ range $pages }} {{ .Title }} @@ -57,7 +57,8 @@ var EmbeddedTemplates = [][2]string{ {{ end }} -`}, + +`}, {`_default/sitemap.xml`, `{{ printf "" | safeHTML }} @@ -79,17 +80,18 @@ var EmbeddedTemplates = [][2]string{ />{{ end }} {{ end }} -`}, + +`}, {`_default/sitemapindex.xml`, `{{ printf "" | safeHTML }} - {{ range . }} - - {{ .SitemapAbsURL }} - {{ if not .LastChange.IsZero }} - {{ .LastChange.Format "2006-01-02T15:04:05-07:00" | safeHTML }} - {{ end }} - - {{ end }} + {{ range . }} + + {{ .SitemapAbsURL }} + {{ if not .LastChange.IsZero }} + {{ .LastChange.Format "2006-01-02T15:04:05-07:00" | safeHTML }} + {{ end }} + + {{ end }} `}, {`alias.html`, `{{ .Permalink }}`}, diff --git a/tpl/tplimpl/embedded/templates/_default/rss.xml b/tpl/tplimpl/embedded/templates/_default/rss.xml index 8bdf02ad..7acdbef6 100644 --- a/tpl/tplimpl/embedded/templates/_default/rss.xml +++ b/tpl/tplimpl/embedded/templates/_default/rss.xml @@ -22,9 +22,9 @@ {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }} {{.}}{{end}}{{ if not .Date.IsZero }} {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} - {{ with .OutputFormats.Get "RSS" }} - {{ printf "" .Permalink .MediaType | safeHTML }} - {{ end }} + {{- with .OutputFormats.Get "RSS" -}} + {{ printf "" .Permalink .MediaType | safeHTML }} + {{- end -}} {{ range $pages }} {{ .Title }} @@ -36,4 +36,4 @@ {{ end }} - \ No newline at end of file + diff --git a/tpl/tplimpl/embedded/templates/_default/sitemap.xml b/tpl/tplimpl/embedded/templates/_default/sitemap.xml index cd2cab73..63f51195 100644 --- a/tpl/tplimpl/embedded/templates/_default/sitemap.xml +++ b/tpl/tplimpl/embedded/templates/_default/sitemap.xml @@ -19,4 +19,4 @@ />{{ end }} {{ end }} - \ No newline at end of file + diff --git a/tpl/tplimpl/embedded/templates/_default/sitemapindex.xml b/tpl/tplimpl/embedded/templates/_default/sitemapindex.xml index 62131a98..01cf65bc 100644 --- a/tpl/tplimpl/embedded/templates/_default/sitemapindex.xml +++ b/tpl/tplimpl/embedded/templates/_default/sitemapindex.xml @@ -1,11 +1,11 @@ {{ printf "" | safeHTML }} - {{ range . }} - - {{ .SitemapAbsURL }} - {{ if not .LastChange.IsZero }} - {{ .LastChange.Format "2006-01-02T15:04:05-07:00" | safeHTML }} - {{ end }} - - {{ end }} + {{ range . }} + + {{ .SitemapAbsURL }} + {{ if not .LastChange.IsZero }} + {{ .LastChange.Format "2006-01-02T15:04:05-07:00" | safeHTML }} + {{ end }} + + {{ end }} -- 2.30.2