Merge pull request #799 from heyakyra/twitter-card-fix-large-preview

Conditionally use twitter large summary card format when an image is available
pull/822/head
Matt Baer 1 year ago committed by GitHub
commit a1becfdc83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      templates/post.tmpl

@ -19,7 +19,7 @@
<meta name="description" content="{{.Description}}">
<meta itemprop="name" content="{{.SiteName}}">
<meta itemprop="description" content="{{.Description}}">
<meta name="twitter:card" content="summary">
<meta name="twitter:card" content="{{if gt (len .Images) 0}}summary_large_image{{else}}summary{{end}}">
<meta name="twitter:title" content="{{if .Title}}{{.Title}}{{else}}{{.GenTitle}}{{end}}">
<meta name="twitter:description" content="{{.Description}}">
{{if gt .Views 1}}<meta name="twitter:label1" value="Views">

Loading…
Cancel
Save