Created
October 22, 2012 21:19
-
-
Save alaiacano/3934462 to your computer and use it in GitHub Desktop.
optionally display source attribution in a tumblr theme
This file contains hidden or 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
{block:Posts} | |
<script language="JavaScript"> | |
var source_url = '{block:ContentSource}{SourceURL}{/block:ContentSource}'; | |
var reblogged_from = '{block:RebloggedFrom}{ReblogParentName}{/block:RebloggedFrom}' + '.tumblr.com'; | |
if (source_url.indexOf(reblogged_from) == -1) { | |
document.write('Your attribution string!'); | |
} | |
</script> | |
{/block:Posts} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this probably won't work for blogs with custom domains like davidslog.com, so you're on your own there.