summaryrefslogtreecommitdiffstats
path: root/tpl/tplimpl/embedded/templates/opengraph.html
diff options
context:
space:
mode:
Diffstat (limited to 'tpl/tplimpl/embedded/templates/opengraph.html')
-rw-r--r--tpl/tplimpl/embedded/templates/opengraph.html12
1 files changed, 7 insertions, 5 deletions
diff --git a/tpl/tplimpl/embedded/templates/opengraph.html b/tpl/tplimpl/embedded/templates/opengraph.html
index c245e5bd1..59e63d6be 100644
--- a/tpl/tplimpl/embedded/templates/opengraph.html
+++ b/tpl/tplimpl/embedded/templates/opengraph.html
@@ -4,21 +4,23 @@
<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 }}
-{{- with or .Params.locale site.Language.LanguageCode site.Language.Lang }}
- <meta property="og:locale" content="{{ . }}">
+{{- with or .Params.locale site.Language.LanguageCode }}
+ <meta property="og:locale" content="{{ replace . `-` `_` }}">
{{- end }}
{{- 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 }}>