diff --git a/tpl/template_embedded.go b/tpl/template_embedded.go
index 3dca82bc5..f782a31e9 100644
--- a/tpl/template_embedded.go
+++ b/tpl/template_embedded.go
@@ -167,7 +167,13 @@ func (t *GoHTMLTemplate) EmbedTemplates() {
{{ end }}{{ end }}
-{{ if not .Date.IsZero }}{{ end }}{{ with .Params.audio }}
+{{ if .IsPage }}
+{{ if not .PublishDate.IsZero }}
+{{ else if not .Date.IsZero }}{{ end }}
+{{ if not .Lastmod.IsZero }}{{ end }}
+{{ else }}
+{{ if not .Date.IsZero }}{{ end }}
+{{ end }}{{ with .Params.audio }}
{{ end }}{{ with .Params.locale }}
{{ end }}{{ with .Site.Params.title }}
{{ end }}{{ with .Params.videos }}
@@ -189,8 +195,6 @@ func (t *GoHTMLTemplate) EmbedTemplates() {
{{ range .Site.Authors }}{{ with .Social.facebook }}
{{ end }}{{ with .Site.Social.facebook }}
{{ end }}
-
-
{{ with .Params.tags }}{{ range first 6 . }}
{{ end }}{{ end }}