I'm testing out fastpages - a great new tool that (among other things) let's you write blog posts in Jupyter and host them for free using Github pages. This post documents how I moved my past blog posts across from wordpress (datasciencecastnet.home.blog) into fastpages.

The Steps

These are the basic steps I followed:

Some optional extra steps to deal with images:

  • Export the media from my wordpress. The markdown files link to images hosted by wordpress, but these seem to load really slowly. Exporting the images and saving them in a 'wordpress_export' folder within the 'images' folder of the fastpages blog let's you have full control over the images and hosting.
  • Change the image references in the markdown posts. There are various ways you could do this, but since this post is a jupyter notebook let's do it with a bit of python code!
# Get a list of posts
import glob
posts = glob.glob('../_posts/*.md')

# replace the image URLs to point to our new images
for post in posts:
    s = open(post, 'r').read()
    s = s.replace('https://datasciencecastnethome.files.wordpress.com', '{{ site.baseurl }}/images/wordpress_export')
    f = open(post, 'w')
    f.write(s)
    f.close()

Push your changes, and wait a few minutes for the build process to finish. Then check out your shiny new blog!