diff --git a/tpl/template_embedded.go b/tpl/template_embedded.go
index d09ef8447..dbeace556 100644
--- a/tpl/template_embedded.go
+++ b/tpl/template_embedded.go
@@ -50,18 +50,18 @@ func (t *GoHtmlTemplate) EmbedTemplates() {
{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}
{{ .Permalink }}
Recent content {{ with .Title }}in {{.}} {{ end }}on {{ .Site.Title }}
- Hugo -- gohugo.io
- {{ with .Site.LanguageCode }}{{.}}{{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 -0700" }}
+ Hugo -- gohugo.io{{ with .Site.LanguageCode }}
+ {{.}}{{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}}{{ if not .Date.IsZero }}
+ {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHtml }}{{ end }}
{{ range first 15 .Data.Pages }}
-
{{ .Title }}
{{ .Permalink }}
- {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}
+ {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHtml }}
{{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}
{{ .Permalink }}
{{ .Content | html }}
@@ -73,8 +73,8 @@ func (t *GoHtmlTemplate) EmbedTemplates() {
t.AddInternalTemplate("_default", "sitemap.xml", `
{{ range .Data.Pages }}
- {{ .Permalink }}
- {{ safeHtml ( .Date.Format "2006-01-02T15:04:05-07:00" ) }}{{ with .Sitemap.ChangeFreq }}
+ {{ .Permalink }}{{ if not .Date.IsZero }}
+ {{ safeHtml ( .Date.Format "2006-01-02T15:04:05-07:00" ) }}{{ end }}{{ with .Sitemap.ChangeFreq }}
{{ . }}{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
{{ .Sitemap.Priority }}{{ end }}
@@ -134,7 +134,7 @@ func (t *GoHtmlTemplate) EmbedTemplates() {
{{ end }}{{ end }}
-{{ with .Params.audio }}
+{{ with .Params.audio }}
{{ end }}{{ with .Params.locale }}
{{ end }}{{ with .Site.Params.title }}
{{ end }}{{ with .Params.videos }}
@@ -192,9 +192,9 @@ func (t *GoHtmlTemplate) EmbedTemplates() {
-{{if .IsPage}}{{ $ISO8601 := "2006-01-02T15:04:05-07:00" }}{{ if ne (.PublishDate.Format $ISO8601) "0001-01-01T00:00:00+00:00" }}
-{{ end }}
-
+{{if .IsPage}}{{ $ISO8601 := "2006-01-02T15:04:05-07:00" }}{{ if not .PublishDate.IsZero }}
+{{ end }}
+
{{ with .Params.images }}{{ range first 6 . }}