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
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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