Make Twitter card without having Twitter account (#284)

Merge pull request 284
This commit is contained in:
Wei-Chung Liao 2019-10-30 12:00:00 -04:00 committed by jekyllbot
parent 242ad4f127
commit 39442c20c6
1 changed files with 11 additions and 7 deletions

View File

@ -51,15 +51,19 @@
<link rel="next" href="{{ paginator.next_page_path | absolute_url }}" />
{% endif %}
{% if site.twitter %}
{% if seo_tag.image %}
<meta name="twitter:card" content="{{ page.twitter.card | default: site.twitter.card | default: "summary_large_image" }}" />
<meta property="twitter:image" content="{{ seo_tag.image.path }}" />
{% else %}
<meta name="twitter:card" content="summary" />
{% endif %}
{% if seo_tag.image %}
<meta name="twitter:card" content="{{ page.twitter.card | default: site.twitter.card | default: "summary_large_image" }}" />
<meta property="twitter:image" content="{{ seo_tag.image.path }}" />
{% else %}
<meta name="twitter:card" content="summary" />
{% endif %}
{% if seo_tag.page_title %}
<meta property="twitter:title" content="{{ seo_tag.page_title }}" />
{% endif %}
{% if site.twitter %}
<meta name="twitter:site" content="@{{ site.twitter.username | replace:"@","" }}" />
{% if seo_tag.author.twitter %}