From 9150a98f3ed0f9b7732e80eb181194532bc2e189 Mon Sep 17 00:00:00 2001 From: Anthony Fok Date: Wed, 14 Jan 2015 21:05:13 -0700 Subject: [PATCH] Replace `if` with `with` in embedded rss.xml ... resulting in a slightly more compact template. --- tpl/template_embedded.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tpl/template_embedded.go b/tpl/template_embedded.go index 74fefb59..6f089aef 100644 --- a/tpl/template_embedded.go +++ b/tpl/template_embedded.go @@ -52,8 +52,8 @@ func (t *GoHtmlTemplate) EmbedTemplates() { Recent content {{ with .Title }}in {{.}} {{ end }}on {{ .Site.Title }} Hugo -- gohugo.io {{ with .Site.LanguageCode }}{{.}}{{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.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} + {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} {{ with .Site.Copyright }}{{.}}{{end}} {{ .Date.Format "Mon, 02 Jan 2006 15:04:05" }} {{ with .Date.Format "MST" }}{{ if eq . "UTC" }}UT{{else}}{{.}}{{end}}{{end}} @@ -62,7 +62,7 @@ func (t *GoHtmlTemplate) EmbedTemplates() { {{ .Title }} {{ .Permalink }} {{ .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}} + {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} {{ .Permalink }} {{ .Content | html }} -- 2.30.2