Export Tumblr Posts to nanoc

By Jimmy Bonney | June 8, 2013

Post box

I used to have a blog on Tumblr. I migrated there the content of an old web site back in 2009. It allowed me to keep the content available without having to maintain a server. But time has passed, visits on the Tumblr blog have been almost inexistent, and as I built this new personal site, I decided that it was time to perform some clean up and consolidation. I therefore spent a couple of hours to migrate the posts that were just lying down on Tumblr to this web site. And well, since Yahoo bought Tumblr not long ago, it will also allow me to ensure that I keep ownership on the content I wrote.

This blog is built with nanoc and all posts are written in markdown. Fortunately, some tools already exist to export Tumblr posts to markdown articles. First thing to do is install npm and pandoc:

sudo apt-get install npm
sudo apt-get install pandoc

Once this is done, just follow the instructions on GitHub to install the sky-tumblr-export tool and export your blog.

npm install -g sky-tumblr-export
sky-tumblr-export -u yourwebsite.com -d /tmp/yourwebsite

Once this is done, there are just a couple of things to fix to be completely independent from Tumblr:

  1. Fix images links: they are by default hosted on http://media.tumblr.com/
  2. Fix internal links: correct links from your blog to your own posts
  3. Fix code: code blocks were not imported correctly

You can find the imported posts (from January 2008 to October 2009) in the articles section.

For the time being, comments are managed by Disqus, a third-party library. I will eventually replace it with another solution, but the timeline is unclear. Considering the amount of data being loaded, if you would like to view comments or post a comment, click on the button below. For more information about why you see this button, take a look at the following article.