Skip to content

Commit 3a0a481

Browse files
jmooringadityatelange
authored andcommitted
[PATCH] Fix date format in schema and opengraph templates
cherry-picked from gohugoio/hugo@34e4742
1 parent ddfea82 commit 3a0a481

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

layouts/partials/templates/opengraph.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
{{- if .IsPage }}
2828
{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
2929
<meta property="article:section" content="{{ .Section }}" />
30-
{{ with .PublishDate }}<meta property="article:published_time" content="{{ .Format $iso8601 }}" />{{ end }}
31-
{{ with .Lastmod }}<meta property="article:modified_time" content="{{ .Format $iso8601 }}" />{{ end }}
30+
{{ with .PublishDate }}<meta property="article:published_time" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end }}
31+
{{ with .Lastmod }}<meta property="article:modified_time" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end }}
3232
{{- end -}}
3333

3434
{{- with .Params.audio }}<meta property="og:audio" content="{{ . }}" />{{ end }}

0 commit comments

Comments
 (0)