From: Kyle Anderson Date: Wed, 12 Aug 2020 05:34:04 +0000 (-0700) Subject: Remove trailing whitespace and tabs from RSS templates X-Git-Tag: v0.75.0~69 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=5f42590144579c318a444ea2ce46d5c3fbbbfe6e;p=brevno-suite%2Fhugo 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. --- 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 }}