-
-
Save calvinmetcalf/5910196 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Add the following lines to theme's html code right before </head> --> | |
<link rel="stylesheet" href="//gist.github.com/assets/embed-bfcadee384027982121fdeb9930e78b2.css" /> | |
<!-- add the folowing if jquery isn't already included in your theme--> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script> | |
<!-- add the following to the bottom of the theme--> | |
<script> | |
$(function() { | |
function makeGist(d){ | |
var link = $($(d).html())[0]; | |
if(link){ | |
$.ajax({ | |
url:link.innerHTML+'.json', | |
dataType:'jsonp' | |
}).then(function(data){ | |
d.html(data.div); | |
}); | |
} | |
} | |
$('.gist').each(function(i,v){ | |
makeGist($(v)); | |
}); | |
}); | |
</script> | |
<!-- | |
Usage: just add <div class="gist">[gist URL]</div> | |
Example: <div class="gist">https://gist.github.com/1395926</div> | |
--> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks!!