[PATCH] tpl/tplimpl: Fix double-escaping in opengraph template

cherry-picked from gohugoio/hugo@fb51b69
This commit is contained in:
Joe Mooring 2024-04-24 12:15:57 -07:00 committed by Aditya Telange
parent d360267d4e
commit 5a2a88cab1
No known key found for this signature in database
GPG Key ID: 82E844EF3DA99E77
1 changed files with 5 additions and 3 deletions

View File

@ -4,11 +4,11 @@
<meta property="og:site_name" content="{{ . }}">
{{- end }}
{{- with or .Title site.Title site.Params.title | plainify}}
{{- with or .Title site.Title site.Params.title | plainify }}
<meta property="og:title" content="{{ . }}">
{{- end }}
{{- with or .Description .Summary site.Params.description | plainify }}
{{- with or .Description .Summary site.Params.description | plainify | htmlUnescape | chomp }}
<meta property="og:description" content="{{ . }}">
{{- end }}
@ -18,7 +18,9 @@
{{- if .IsPage }}
<meta property="og:type" content="article">
<meta property="article:section" content="{{ .Section }}">
{{- with .Section }}
<meta property="article:section" content="{{ . }}">
{{- end }}
{{- $ISO8601 := "2006-01-02T15:04:05-07:00" }}
{{- with .PublishDate }}
<meta property="article:published_time" {{ .Format $ISO8601 | printf "content=%q" | safeHTMLAttr }}>