Skip to content

Commit

Permalink
Add Twitter card. relates to #16
Browse files Browse the repository at this point in the history
  • Loading branch information
André Jaenisch authored and bhush9 committed Jul 30, 2017
1 parent b6f6f40 commit 9904c93
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@
{% if jekyll.environment == 'production' and site.google_analytics %}
{% include google-analytics.html %}
{% endif %}

{% include twitter-card.html %}
</head>
10 changes: 10 additions & 0 deletions _includes/twitter-card.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!-- Twitter Card -->
<meta name="twitter:card" content="{% if page.image %}summary_large_image{% else %}summary{% endif %}">
<meta name="twitter:site" content="@{{ site.twitter_username }}">
<meta name="twitter:creator" content="@{{ site.twitter_username }}">
<meta name="twitter:title" content="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}">
<meta name="twitter:description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 200 }}{% else %}{{ site.description}}{% endif %}">
{% if page.image %}
<meta name="twitter:image:src" content="{{ page.image | prepend: site.baseurl | prepend: site.url }}">
{% endif %}
<!-- End Twitter Card -->

0 comments on commit 9904c93

Please sign in to comment.