Skip to content

Instantly share code, notes, and snippets.

@alexbaldwin
Created May 9, 2013 17:17
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save alexbaldwin/5548993 to your computer and use it in GitHub Desktop.
Save alexbaldwin/5548993 to your computer and use it in GitHub Desktop.
Middleman Blog Twitter card integration
<% 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