From c1b3e978b7d8c6ec89d804d00e8bb306f45adbb4 Mon Sep 17 00:00:00 2001 From: TommySprat <> Date: Thu, 13 Jun 2019 00:07:36 +0200 Subject: [PATCH] Remove escape characters in formatted date Without the quotes in the template the '+' character will no longer needlessly be escaped as '\x2b' --- layouts/_default/list.html | 2 +- layouts/_default/single.html | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 1461424..d9249da 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -12,7 +12,7 @@ }, {{- $ISO8601 := "2006-01-02T15:04:05-07:00" }} {{- if not .Date.IsZero }} - "dateModified": "{{ .Date.Format $ISO8601 }}", + "dateModified": {{ .Date.Format $ISO8601 }}, {{- end }} {{- with .Site.Social.GooglePlus }} "publisher": "{{ printf "%s" . }}", diff --git a/layouts/_default/single.html b/layouts/_default/single.html index ac9cfa3..6f8967d 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -25,12 +25,12 @@ "wordCount": "{{ .WordCount }}", {{- $ISO8601 := "2006-01-02T15:04:05-07:00" }} {{- if not .PublishDate.IsZero }} - "datePublished": "{{ .PublishDate.Format $ISO8601 }}", + "datePublished": {{ .PublishDate.Format $ISO8601 }}, {{- else }} - "datePublished": "{{ .Date.Format $ISO8601 }}", + "datePublished": {{ .Date.Format $ISO8601 }}, {{- end }} {{- if not .Lastmod.IsZero }} - "dateModified": "{{ .Lastmod.Format $ISO8601 }}", + "dateModified": {{ .Lastmod.Format $ISO8601 }}, {{- end }} {{- with .Site.Social.GooglePlus }} "publisher": "{{ printf "%s" . }}",