Tumblr says you can't paste Github Gists into your blog.
Use this hack to do it anyway.
This is mostly a hack-job of writeCapture, and inspired by this gist.
gist-in-tumblr requires jQuery.
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!
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>
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
.
As part of the build process, you must install uglify-js:
$ git clone [email protected]:bobbydavid/gist-in-tumblr.git
$ cd gist-in-tumblr
$ npm install uglify-js
$ make
The files show up in the out/
directory.
Owing to writeCapture being licensed under GPL, this software is under the same.