Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Scripts to embed Gists in your Tumblr blog
branch: master
Failed to load latest commit information.
.gitignore gitignore for build stuff and npm
GPL-LICENSE.txt GPL License required
Makefile update location of uglifyjs, with note
README.md
gist-in-tumblr.js fix bug that stopped subgists from working
jquery.writeCapture.js use jQuery plugin, fix bugs
writeCapture.js working Makefile, update things

README.md

Embed Gists in Tumblr

Tumblr says you can't paste Github Gists into your blog.

Use this hack to do it anyway.

Credits

This is mostly a hack-job of writeCapture, and inspired by this gist.

gist-in-tumblr requires jQuery.

Fast Installation

Copy these scripts into the <head> of the blog:

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="https://github.com/downloads/bobbydavid/gist-in-tumblr/gist-in-tumblr-full.v0.1.1.min.js"></script>

Note that you are linking directly to Github. If you prefer, you can download your own copy and link to it on Tumblr.

To active a Gist, put it in a <p> tag with the class "gist" by itself:

<p class="gist">https://gist.github.com/2553077</p>

Done!

More Detailed Installation

Copy these scripts into the <head> of the blog:

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="https://github.com/downloads/bobbydavid/gist-in-tumblr/gist-in-tumblr-full.v0.1.1.min.js"></script>

For most Tumblr themes, this can be accomplished by clicking "Customize" and then pasting the script tags your "Description" field.

To active a Gist, put it in a <p> tag with the class "gist" by itself. For instance, you start with the Gist on its own paragraph in your blog:

Here is my latest Gist:

https://gist.github.com/2553077

Text continues here...

Then modify the HTML source and add the class 'gist' to the paragraph tag:

<p>Here is my latest Gist:</p>
<p class="gist">https://gist.github.com/2553077</p>
<p>Text continues here...</p>

The Nitty Gritty. And Misc.

Note that gist-in-tumblr currently expects gist URLs to take the form https://gist.github.com/[0-9]+(\?file=.+)?. This means you should not put your own username in the URL. In other words, don't do https://gist.github.com/bobbydavid/12345.

If you want to link just a single file, do https://gist.github.com/12345?file=filename.txt.

Download and Build

As part of the build process, you must install uglify-js:

$ git clone git@github.com:bobbydavid/gist-in-tumblr.git
$ cd gist-in-tumblr
$ npm install uglify-js
$ make

The files show up in the out/ directory.

License

Owing to writeCapture being licensed under GPL, this software is under the same.

Something went wrong with that request. Please try again.