Search code examples
sharetumblr

Tumblr share url


I've came across this page https://www.tumblr.com/examples/share/sharing-links-to-articles.html which shows a possible way to customly create a share URL for tumblr.

Simplified version of what they have:

<a href="http://www.tumblr.com/share/link?url=http%3A%2F%2Fwww.google.com" target="blank_">Click to share</a>

http://jsfiddle.net/m5ow6bhs/2/

This will take you to the log in page or straight to the share page if you're already logged in. However, if you change the http%3A%2F%2F part to a simple http:// it will now load to a "Not Found Page". http://jsfiddle.net/m5ow6bhs/3/ What the hell Tumblr?

Do you guys have any idea what's going on or what's the correct code to share something to Tumblr?

Cheers.


Solution

  • As with most share services, the URL should be passed as an encoded string. This supports the OPs comments about http%3A%2F%2F(encoded) and http:// (raw).

    Tumblr provides variable transformations in the theme operators to handle encoding, but sadly it doesn't work with custom variables.

    One quick solution is to drop the http:// part. Example: http://jsfiddle.net/L9jd8dhz/