From 700c2b8f22a4c0f428abea8dcf61d8876886fc13 Mon Sep 17 00:00:00 2001 From: Anthony Fok Date: Mon, 12 Jan 2015 22:24:37 -0700 Subject: [PATCH] Trivial fixes to get RSS 2.0 feeds to validate. RSS 2.0 requires the email be listed in ``, and `UTC` as a timezone is not accepted, but `UT` or `GMT` are. See #789 for more information. Thanks to @snej for the report! --- tpl/template_embedded.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tpl/template_embedded.go b/tpl/template_embedded.go index eeab7ba5c..74fefb592 100644 --- a/tpl/template_embedded.go +++ b/tpl/template_embedded.go @@ -52,16 +52,17 @@ func (t *GoHtmlTemplate) EmbedTemplates() { Recent content {{ with .Title }}in {{.}} {{ end }}on {{ .Site.Title }} Hugo -- gohugo.io {{ with .Site.LanguageCode }}{{.}}{{end}} - {{ with .Site.Author.name }}{{.}}{{end}} + {{ if .Site.Author.email }}{{.Site.Author.email}}{{ with .Site.Author.name }} ({{.}}){{end}}{{end}} + {{ if .Site.Author.email }}{{.Site.Author.email}}{{ with .Site.Author.name }} ({{.}}){{end}}{{end}} {{ with .Site.Copyright }}{{.}}{{end}} - {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 MST" }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05" }} {{ with .Date.Format "MST" }}{{ if eq . "UTC" }}UT{{else}}{{.}}{{end}}{{end}} {{ range first 15 .Data.Pages }} {{ .Title }} {{ .Permalink }} - {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 MST" }} - {{with .Site.Author.name}}{{.}}{{end}} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05" }} {{ with .Date.Format "MST" }}{{ if eq . "UTC" }}UT{{else}}{{.}}{{end}}{{end}} + {{ if .Site.Author.email }}{{.Site.Author.email}}{{ with .Site.Author.name }} ({{.}}){{end}}{{end}} {{ .Permalink }} {{ .Content | html }}