Over the past weekend, I noticed that my blog is not available since azure has disabled hosting of my WordPress blog. It happened because I ran out of my free credits for the current month. I started looking for alternate options for hosting WordPress. That’s when I came across (Static Generator is All a Blog Needs - Moving to Octopress). I decided to give it a try.
Below are the main steps which I followed for migrating to Octopress
Documentation
Read documentation of Octopress here and Jekyll here
Setup
Install Chocolatey as mentioned in documentation here
Below command can be run on cmd.exe open as administrator
As mentioned in octopress documentation, ensure Git, ruby and devkit are installed. Cholocatey way of installation can be found in git, ruby , devkit.
Below commands can be run on cmd.exe
Fix up all issues. The date displayed as “Ordinal” can be fixed by updating _config.yml file as mentioned in their blog. Below is the config which I used
_config.yml
1
date_format: "%e %b, %Y"
I made few more changes for changing the navigation header color, color of code blocks and also to include a side bar with categories. The changes are as below
Changing color of code blocks is done by commenting below line in octopress\sass\custom\_colors.scss
1
\\$solarized: light;
Navigation header color is changed by adding below to octopress\sass\custom\_styles.scss
Detailed instructions can be found in Deploying to Github Pages. Below are high-level steps copied from there
- Create a GitHub repository with name yourusername.github.io
- Run below command. It will prompt for GitHub URL, which needs to be filled in
cmd.exe
123
rake setup_github_pages // This does all configurations
rake generate
rake deploy
Export old wordpress blog using WordPress exporter in tools/export in WordPress admin
Copy xml file to wordpress-xml directory
Run python exitwp.py in the console from the same directory of unzipped archive
All blogs will be created as separate directory under build directory
Copy relevant folders to source folder of the blog
Find broken redirection links and fix
The redirection links are now changed to something like {site.root}blog/2017/04/07/mountebank-creating-a-response-based-on-a-file-template-and-modifying-it-based-on-request-part-1/
Find broken image links and fix
Inorder to make it easier for migrating to another platform later, I created a new config value in _config.yml as below .
images_dir: /images
The image links are not pointing to {site.images_dir}/2017/04/27/Mountebank_XML_Response_Folder-Tree.jpg
SEO Optimisation in Octopress
In rake file, add below two lines post.puts "keywords: " and post.puts "description: "