aboutsummaryrefslogtreecommitdiffhomepage
path: root/tpl/tplimpl/embedded
diff options
context:
space:
mode:
authorJoe Mooring <[email protected]>2024-04-24 12:15:57 -0700
committerBjørn Erik Pedersen <[email protected]>2024-04-25 10:03:17 +0200
commitfb51b698b3aad83c23328887b20e7ceb6ae75244 (patch)
treee39e20a88ff61aaca9e715c1b4d768e4b5e44a3e /tpl/tplimpl/embedded
parent6b867972ec6df0ce79ddf614bbca039f4daa6060 (diff)
downloadhugo-fb51b698b3aad83c23328887b20e7ceb6ae75244.tar.gz
hugo-fb51b698b3aad83c23328887b20e7ceb6ae75244.zip
tpl/tplimpl: Fix double-escaping in opengraph template
Closes #12418
Diffstat (limited to 'tpl/tplimpl/embedded')
-rw-r--r--tpl/tplimpl/embedded/templates/opengraph.html8
1 files changed, 5 insertions, 3 deletions
diff --git a/tpl/tplimpl/embedded/templates/opengraph.html b/tpl/tplimpl/embedded/templates/opengraph.html
index c245e5bd1..a9b348e9e 100644
--- a/tpl/tplimpl/embedded/templates/opengraph.html
+++ b/tpl/tplimpl/embedded/templates/opengraph.html
@@ -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 }}>