Skip to content

Instantly share code, notes, and snippets.

@calvinmetcalf
Forked from soemarko/theme.html
Last active December 19, 2015 06:19
Show Gist options
  • Save calvinmetcalf/5910196 to your computer and use it in GitHub Desktop.
Save calvinmetcalf/5910196 to your computer and use it in GitHub Desktop.
<!-- 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>
-->
@dennismonsewicz
Copy link

Thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment