Skip to content

Instantly share code, notes, and snippets.

@Shagshag
Forked from tryvin/tumbler-gist-insert.html
Last active May 25, 2018 02:34
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 Shagshag/c9cdb058677b021d2e30bb8d0bdce2c8 to your computer and use it in GitHub Desktop.
Save Shagshag/c9cdb058677b021d2e30bb8d0bdce2c8 to your computer and use it in GitHub Desktop.
Tumblr gist insert
<script src="//static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script>
<script type="text/javascript">
$(function() {
$("a[href]").each(
function(index, element) {
if ( $(element).text().indexOf('gist.github.com') > 0 ) {
var divElement = $('<div></div>');
$(element).after(divElement);
writeCapture.html(divElement, '<script src="'+$(element).text()+'.js"></'+'script>');
$(element).remove();
}
}
);
});
</script>
@soren
Copy link

soren commented May 16, 2018

This was just what I needed, thanks!
I even blogged about it, embedding your gist in a post about how I embed code in my posts (inception): https://brain.369.dk/post/173950942357/embedding-a-github-gist-in-a-tumblr-post

@Shagshag
Copy link
Author

@soren you're welcome

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