Scott W. Bradley

in which scottwb thinks out loud

Fork me on GitHub

Embedded Tweet Tag for Jekyll

| Comments

A nice way to quote a tweet in your blog post is to use Twitter’s Embedded Tweet feature. Not only does it provide a familiar Twitter style, it also provides features like being able to directly retweet, follow, etc., without leaving your page. For example:

If you use Octopress or Jekyll, you can easily embed tweets using the Jekyll Tweet Tag. All you need to do is download tweet_tag.rb and store it in your Jekyll plugins directory.

Then, when you see a tweet you want to quote, click the “Embed this Tweet” link.

When that pops up the dialog, choose the “Shortcode” tab, select your desired alignment, and copy the resulting code into your blog post.

IMPORANT NOTE: Since Twitter generates shortcodes for Wordpress, you still have one more step: convert that code to a Liquid-style tag. All that means is replacing the [...] with {% ... %}. For example:

1
{% tweet https://twitter.com/DEVOPS_BORAT/status/159849628819402752 align='center' %}

For full documentation, see the project README.

That’s all there is to it. If you’re using Octopress with your own fork of the repository, you might be interested in my pull request that imports the jekyll-tweet-tag plugin.

Comments