Skip to content
Embed tweets in Jekyll/Octopress blogs using Twitter's oEmbed API.
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.

Liquid Tweet Tag for Jekyll and Octopress

This is a simple Liquid tag that makes it easy to embed tweets. This is great for quoting a tweet in a blog post, for example. It uses Twitter's oEmbed API for their Embedded Tweet feature. Features include:

  • Easy to install
  • Easy to embed tweets
  • Displays tweets with familiar twitter style
  • Optional parameters to control layout (as described in Twitter's oEmbed API)
  • Provides twitter features such as retweet, follow, and favorite without leaving your page

How To Install

  1. Copy tweet_tag.rb into <your-jekyll-project>/_plugins or <your-ocotpress-project>/plugins.
  2. That is all.

How To use

Place a tweet tag in your content file, using the URL to the tweet, e.g.:

{% tweet %}

You can also just copy the Wordpress shortcode generated by Twitter's "Embed this Tweet" UI and change the [...] to {% ... %}. For example:

{% tweet align='right' width='350' %}

The first argument to the tweet tag must be the tweet URL, but everything after that is optional. You can pass any parameter supported by the Twitter oEmbed API in the form key='value'.

In an attempt to maintain compatibility with Robert Böhnke's Tag, the tweet tag wraps the embedded code with a <div class='embed tweet'>.


The Twitter oEmbed API is rate-limited. The tweet tag caches all API responses in a directory named .tweet-cache. This way, regenerating your site does not re-query for every embedded tweet every time. You can safely delete the .tweet-cache directory. It will be recreated and embedded tweets will be re-queried.

You can also use the tweetnocache tag to embed a tweet that bypasses the cache. This is not recommended since it will request the embed code from twitter every time that page is regenerated.


Scott W. Bradley --


This code is inspired by the Gist Tag plugin by Brandon Tilley and the oEmbed Tag by Tammo van Lessen.


This code is licensed under Apache License 2.0

You can’t perform that action at this time.