Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/adityatelange/hugo-PaperMod.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Mooring <joe.mooring@veriphor.com>2021-06-20 22:30:41 +0300
committerAditya Telange <21258296+adityatelange@users.noreply.github.com>2022-09-03 13:59:45 +0300
commit3a0a4811cbc07c0bea09ef55b3c1bfb39b48cddd (patch)
tree79b38c73a9aa9ae3f9b99bd81ec966a5e43ed058
parentddfea82cc75c93074194490df3805d28f7852248 (diff)
[PATCH] Fix date format in schema and opengraph templates
cherry-picked from https://github.com/gohugoio/hugo/commit/34e4742f0caab0d3eb9efd00fce4157d112617b5
-rw-r--r--layouts/partials/templates/opengraph.html4
1 files changed, 2 insertions, 2 deletions
diff --git a/layouts/partials/templates/opengraph.html b/layouts/partials/templates/opengraph.html
index 13e7b2bd..9e8df143 100644
--- a/layouts/partials/templates/opengraph.html
+++ b/layouts/partials/templates/opengraph.html
@@ -27,8 +27,8 @@
{{- if .IsPage }}
{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
<meta property="article:section" content="{{ .Section }}" />
-{{ with .PublishDate }}<meta property="article:published_time" content="{{ .Format $iso8601 }}" />{{ end }}
-{{ with .Lastmod }}<meta property="article:modified_time" content="{{ .Format $iso8601 }}" />{{ end }}
+{{ with .PublishDate }}<meta property="article:published_time" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end }}
+{{ with .Lastmod }}<meta property="article:modified_time" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end }}
{{- end -}}
{{- with .Params.audio }}<meta property="og:audio" content="{{ . }}" />{{ end }}