diff options
author | Kyle Anderson <kyle@xkyle.com> | 2020-08-11 22:34:04 -0700 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-08-12 09:25:16 +0200 |
commit | 5f42590144579c318a444ea2ce46d5c3fbbbfe6e (patch) | |
tree | 9d38ceec1989ea75a593d9ac108a8042a2b4d9d9 /tpl | |
parent | f3cb0be35adddfe43423a19116994b53817d97f7 (diff) |
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.
Diffstat (limited to 'tpl')
-rw-r--r-- | tpl/tplimpl/embedded/templates.autogen.go | 28 | ||||
-rw-r--r-- | tpl/tplimpl/embedded/templates/_default/rss.xml | 8 | ||||
-rw-r--r-- | tpl/tplimpl/embedded/templates/_default/sitemap.xml | 2 | ||||
-rw-r--r-- | tpl/tplimpl/embedded/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 190c88e32..6a6844933 100644 --- a/tpl/tplimpl/embedded/templates.autogen.go +++ b/tpl/tplimpl/embedded/templates.autogen.go @@ -43,9 +43,9 @@ var EmbeddedTemplates = [][2]string{ <webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }} <copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }} <lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }} - {{ with .OutputFormats.Get "RSS" }} - {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }} - {{ end }} + {{- with .OutputFormats.Get "RSS" -}} + {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }} + {{- end -}} {{ range $pages }} <item> <title>{{ .Title }}</title> @@ -57,7 +57,8 @@ var EmbeddedTemplates = [][2]string{ </item> {{ end }} </channel> -</rss>`}, +</rss> +`}, {`_default/sitemap.xml`, `{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }} <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml"> @@ -79,17 +80,18 @@ var EmbeddedTemplates = [][2]string{ />{{ end }} </url> {{ end }} -</urlset>`}, +</urlset> +`}, {`_default/sitemapindex.xml`, `{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }} <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> - {{ range . }} - <sitemap> - <loc>{{ .SitemapAbsURL }}</loc> - {{ if not .LastChange.IsZero }} - <lastmod>{{ .LastChange.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</lastmod> - {{ end }} - </sitemap> - {{ end }} + {{ range . }} + <sitemap> + <loc>{{ .SitemapAbsURL }}</loc> + {{ if not .LastChange.IsZero }} + <lastmod>{{ .LastChange.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</lastmod> + {{ end }} + </sitemap> + {{ end }} </sitemapindex> `}, {`alias.html`, `<!DOCTYPE html><html><head><title>{{ .Permalink }}</title><link rel="canonical" href="{{ .Permalink }}"/><meta name="robots" content="noindex"><meta charset="utf-8" /><meta http-equiv="refresh" content="0; url={{ .Permalink }}" /></head></html>`}, diff --git a/tpl/tplimpl/embedded/templates/_default/rss.xml b/tpl/tplimpl/embedded/templates/_default/rss.xml index 8bdf02ad7..7acdbef6b 100644 --- a/tpl/tplimpl/embedded/templates/_default/rss.xml +++ b/tpl/tplimpl/embedded/templates/_default/rss.xml @@ -22,9 +22,9 @@ <webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }} <copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }} <lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }} - {{ with .OutputFormats.Get "RSS" }} - {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }} - {{ end }} + {{- with .OutputFormats.Get "RSS" -}} + {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }} + {{- end -}} {{ range $pages }} <item> <title>{{ .Title }}</title> @@ -36,4 +36,4 @@ </item> {{ end }} </channel> -</rss>
\ No newline at end of file +</rss> diff --git a/tpl/tplimpl/embedded/templates/_default/sitemap.xml b/tpl/tplimpl/embedded/templates/_default/sitemap.xml index cd2cab732..63f51195b 100644 --- a/tpl/tplimpl/embedded/templates/_default/sitemap.xml +++ b/tpl/tplimpl/embedded/templates/_default/sitemap.xml @@ -19,4 +19,4 @@ />{{ end }} </url> {{ end }} -</urlset>
\ No newline at end of file +</urlset> diff --git a/tpl/tplimpl/embedded/templates/_default/sitemapindex.xml b/tpl/tplimpl/embedded/templates/_default/sitemapindex.xml index 62131a987..01cf65bc5 100644 --- a/tpl/tplimpl/embedded/templates/_default/sitemapindex.xml +++ b/tpl/tplimpl/embedded/templates/_default/sitemapindex.xml @@ -1,11 +1,11 @@ {{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }} <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> - {{ range . }} - <sitemap> - <loc>{{ .SitemapAbsURL }}</loc> - {{ if not .LastChange.IsZero }} - <lastmod>{{ .LastChange.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</lastmod> - {{ end }} - </sitemap> - {{ end }} + {{ range . }} + <sitemap> + <loc>{{ .SitemapAbsURL }}</loc> + {{ if not .LastChange.IsZero }} + <lastmod>{{ .LastChange.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</lastmod> + {{ end }} + </sitemap> + {{ end }} </sitemapindex> |