Skip to content

Commit

Permalink
[PATCH] tpl/tplimpl: Fix double-escaping in opengraph template
Browse files Browse the repository at this point in the history
cherry-picked from gohugoio/hugo@fb51b69
  • Loading branch information
jmooring authored and adityatelange committed Nov 9, 2024
1 parent d360267 commit 5a2a88c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions layouts/partials/templates/opengraph.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand All @@ -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 }}>
Expand Down

0 comments on commit 5a2a88c

Please sign in to comment.