Permalink
Browse files

Use more canonical "twitter:image" property, not "twitter:image:src"

  • Loading branch information...
kaushalmodi authored and bep committed Feb 8, 2018
1 parent f554503 commit 76d38d5e5322fc6220fb9e74f9ca0668606ebb5d
Showing with 3 additions and 3 deletions.
  1. +3 −3 tpl/tplimpl/template_embedded.go
@@ -233,18 +233,18 @@ func (t *templateHandler) embedTemplates() {
t.addInternalTemplate("", "twitter_cards.html", `{{- with $.Params.images -}}
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:image:src" content="{{ index . 0 | absURL }}"/>
<meta name="twitter:image" content="{{ index . 0 | absURL }}"/>
{{ else -}}
{{- $images := $.Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*feature*" -}}
{{- $featured := cond (ne $featured nil) $featured ($images.GetMatch "{*cover*,*thumbnail*}") -}}
{{- with $featured -}}
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:image:src" content="{{ $featured.Permalink }}"/>
<meta name="twitter:image" content="{{ $featured.Permalink }}"/>
{{- else -}}
{{- with $.Site.Params.images -}}
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:image:src" content="{{ index . 0 | absURL }}"/>
<meta name="twitter:image" content="{{ index . 0 | absURL }}"/>
{{ else -}}
<meta name="twitter:card" content="summary"/>
{{- end -}}

0 comments on commit 76d38d5

Please sign in to comment.