Created
May 9, 2013 17:17
-
-
Save alexbaldwin/5548993 to your computer and use it in GitHub Desktop.
Middleman Blog Twitter card integration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% if current_article %> | |
<title><%= "#{current_article.title}" %></title> | |
<meta name="twitter:card" content="summary"> | |
<meta property="twitter:creator" content="@alexbaldwin"> | |
<meta name="twitter:title" content="<%= truncate(current_article.title, length: 70) %>"> | |
<meta name="twitter:image" content="<%= "#{current_article.data.image}" %>"> | |
<meta name="twitter:description" content="<%= truncate(strip_tags(current_article.summary), length: 200) %>"> | |
<meta name="twitter:domain" content="<%= "http://www.alexbaldwin.com#{current_article.url}" %>"> | |
<% else %> | |
<title><%= "Alex Baldwin, Product Designer" %></title> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment