From edcdb6f49ce57f79e6faede661a9c61a8d21eab7 Mon Sep 17 00:00:00 2001 From: Anthony Fok Date: Tue, 20 Jan 2015 02:43:42 -0700 Subject: [PATCH] Fix two errors in two internal templates * template: _internal/_default/opengraph.html:39: unexpected EOF * template: _internal/_default/schema.html:15: unexpected {{end}} Also change the DateTime inside these templates to ISO 8601 format, and skip if `publishdate` is not set. Perhaps it would be a good idea to expose `func (Time) IsZero` to our templates? :-) --- tpl/template_embedded.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tpl/template_embedded.go b/tpl/template_embedded.go index 50849e234..111045535 100644 --- a/tpl/template_embedded.go +++ b/tpl/template_embedded.go @@ -99,20 +99,20 @@ func (t *GoHtmlTemplate) EmbedTemplates() { // Add SEO & Social metadata t.AddInternalTemplate("_default", "opengraph.html", ` - + {{ with .Params.images }}{{ range first 6 . }} {{ end }}{{ end }} -{{ with .Params.audio }} +{{ with .Params.audio }} {{ end }}{{ with .Params.locale }} {{ end }}{{ with .Site.Params.title }} {{ end }}{{ with .Params.videos }} {{ range .Params.videos }} -{{ end }} +{{ end }}{{ end }} {{ $permalink := .Permalink }} @@ -133,7 +133,7 @@ func (t *GoHtmlTemplate) EmbedTemplates() { {{ with .Params.tags }}{{ range first 6 . }} {{ end }}{{ end }} -{{ end }} +{{ end }}{{ end }} {{ with .Site.Social.facebook_admin }}{{ end }}`) @@ -162,11 +162,11 @@ func (t *GoHtmlTemplate) EmbedTemplates() { t.AddInternalTemplate("_default", "schema.html", `{{ with .Site.Social.GooglePlus }}{{ end }} - + -{{if .IsPage}} - - +{{if .IsPage}}{{ $ISO8601 := "2006-01-02T15:04:05-07:00" }}{{ if ne (.PublishDate.Format $ISO8601) "0001-01-01T00:00:00+00:00" }} +{{ end }} + {{ with .Params.images }}{{ range first 6 . }} @@ -174,6 +174,6 @@ func (t *GoHtmlTemplate) EmbedTemplates() { -{{ end }}{{ end }}`) +{{ end }}`) }