mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
tpl/tplimpl: Plainify title and description in twitter_cards.html
Closes #12433 Improves #10900
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
92290aa892
commit
74ab839ccb
@@ -1,12 +1,18 @@
|
||||
{{- $images := partial "_funcs/get-page-images" . -}}
|
||||
{{- with index $images 0 -}}
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:image" content="{{ .Permalink }}">
|
||||
{{- else -}}
|
||||
<meta name="twitter:card" content="summary">
|
||||
{{- end -}}
|
||||
<meta name="twitter:title" content="{{ .Title }}">
|
||||
<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}">
|
||||
{{- $images := partial "_funcs/get-page-images" . }}
|
||||
{{- with index $images 0 }}
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:image" content="{{ .Permalink }}">
|
||||
{{- else }}
|
||||
<meta name="twitter:card" content="summary">
|
||||
{{- end }}
|
||||
|
||||
{{- with or .Title site.Title site.Params.title | plainify }}
|
||||
<meta name="twitter:title" content="{{ . }}">
|
||||
{{- end }}
|
||||
|
||||
{{- with or .Description .Summary site.Params.description | plainify | htmlUnescape | chomp }}
|
||||
<meta name="twitter:description" content="{{ . }}">
|
||||
{{- end }}
|
||||
|
||||
{{- $twitterSite := "" }}
|
||||
{{- with site.Params.social }}
|
||||
|
Reference in New Issue
Block a user