Digestible DevOps

Let's try this again, shall we?

March 27, 2018 | 2 Minute Read

After taking a long time off from trying this whole online presence thing, I’m going to give it another shot. One of the things that discouraged me previously was the way that I interacted with WordPress. So should I try to figure out how to get better at using WordPress? Should I search for newer better plugins that always stay up to date and never cause problems? That sounds hard. It sounds a lot easier to switch to a different platform. Jekyll sounds good…

I installed Ruby 2.4.3 with the dev toolkit. The first time I ran the installer, I only ran the MYSYS2 base installation, so I had to run ridk install again, telling it this time to install “MSYS2 and MINGW development toolchain” (option 3). Prior to doing this I was getting an error about make not being a recognized command when trying to install the jekyll gem.

Then I started ripping off commands in PowerShell:

gem install jekyll bundler

With the base Jekyll installation ready, I wanted to try it out, so I created a new site:

Set-Location $env:USERPROFILE\Source\Repos
jekyll new whatbrendonthinks.com
Set-Location .\whatbrendonthinks.com
bundle exec jekyll serve

And there was much rejoicing.

Now I had all the needed tools at the ready. Next I needed to connect into my WordPress site and do an export of “All content”, which I saved as $env:USERPROFILE\Source\Repos\whatbrendonthinks.com\wordpress-export.xml

Next I installed a couple items to use for importing my WordPress posts/pages and did the actual import:

Set-Location $env:USERPROFILE\Source\Repos\whatbrendonthinks.com
gem install jekyll-import open_uri_redirections
ruby -rubygems -e "require 'jekyll-import'; JekyllImport::Importers::WordpressDotCom.run({ 'source' => 'wordpress-export.xml' })"
bundle exec jekyll serve

I’m not sure what would have happened if I had started with an import versus doing the jekyll new first, but the way that I did it I ended up with some of the example data mixed in with my data, though it was segregated enough to easily pull out or modify to fit my needs.