jquery

gist JS

Wednesday, June 12, 2013

Github gists on blogger




I've been using https://github.com/moski/gist-Blogger/ to display gists in blogger like:



The only problem with this was that I was including a link to the raw github which was getting a mime type of text/plain, which caused some browsers to not load the JS. The solution is to use github pages apparently, but that a small pita to setup, so I hereby share the results of my toils. 


Step 1: Create your gist

Step 2: Add a div to your blog post

<div class="gistLoad" data-id="5561359" id="gist-5561359"> </div>

Step 3: Add this script to your blog post
<script src="http://jdwyah.github.io/gist-Blogger/javascript/gistLoader.js" type="text/javascript"></script>


Step 4: Profit

1 comment:

Anonymous said...

Maybe you could also say that this is *not* your shit...