Express install Jekyll on Windows and import a Wordpress blog27 Nov 2014
There’s a huge array of great posts covering installing Jekyll and migrating from Wordpress to Jekyll. I still needed to pull everything together from a few sources (and needed some test material for my first post since migrating to Jekyll), so I’ve put together a quick shortcut guide (mostly scripted) below. Past this point, I’ll assume you’ve already made the decision to jump ship and just need a quick set of commands to run!
Pull up a powershell terminal elevated to Administrator and lets get going.
Install Jekyll locally on Windows for debugging (optional)
Grab an awesome template of your choice
Give our new blog a test run
Check it out at http://localhost:4000!
Host your blog
There’s lots of hosting options - after all, Jekyll ends up generating plain old HTML! GitHub Pages is a common choice - they’ll both build the content and host the result for you and it’s free including using a custom domain name.
- Create a repository on GitHub Pages named yourgithubusername.github.io.
- Create a git repository using the template folder from the previous section and push it up to your new GitHub repository using your tool of choice. You’ll want to make sure you’ve pushed to the master branch of the repository.
- Hang tight! It might take up to 10 minutes, but your blog should become available at http://yourgithubusername.github.io.
Migrate from Wordpress
In your wordpress admin panel, Tools > Export > All Content. Save the resultant file to your blog folder as wordpress.xml, or modify the filename in the command below.
Set your permalink configuration to match the Wordpress default (customise this if you need to):
The above will have imported all your posts and images. A common requirement at this point is to set up a comment plugin such as Disqus and import your old comments.
- Create a Disqus account
- Grab the Universal Code snippet and drop it into your blog wherever you’d like comments to appear. In our example template above, you’d most likely drop it into _layouts\post.html.
- To make sure we exclude index.html from our URL which Disqus uses to uniquely identify a page, drop the following line into the template for each page - in the above, _includes\head.html (inside <head></head>):
In the Disqus admin panel under Discussions -> Import -> Wordpress, upload your wordpress.xml file from earlier. You can now delete that file. You’ll need to make sure your new blog URLs match the old ones for comments to carry across properly, though Disqus has some cool tools to help you migrate domains/URL formats in their admin panel under the Discussions -> Edit tab.
All done! There’s loads more you can do to customise Jekyll from here. Check out plugins supported by GitHub Pages, settings up a custom domain, troubleshooting GitHub Pages build failures, and this infinite scroll plugin which slots right in to most Jekyll templates with no markup changes.