Is This Thing On?
tap, tap, tap Hello, is this thing on?
I started this blog way back in 2008 and was fairly active through to 2012. Unfortunately, apart from a period in 2017, it has been dormant since then. Working for a hedge fund, who are notoriously secretive, and having children, who are notoriously good at sucking up all your free time, meant that blogging really wasn’t an option. Now I work for a more open company (Ocado Technology) and my kids are a little older, so require a bit less time, I’m hoping to resurrect my blog.
Originally I created the blog on Wordpress.com, which worked great. It was free, reliable, and easy to use. Unfortunately, when I started writing a new post the editor had become unusable for me. Perhaps I’m an old fuddy-duddy, but I just want to be able to write my text, add some simple pictures, and have the editor get out of my way. Sadly, it quickly became clear that WordPress was going to get in my way, so it was time to give the blog a new home and a new lick of paint.
Of course, the only way to start a new project is to buy a domain name. After trying some variations on my name I discovered that theandrewwilkinson.com so I snapped it up. I don’t think I can claim to be the Andrew Wilkinson. I’m not even the most successful Andrew Wilkinson in tech, that has to be this Andrew Wilkinson. However, it beats a wordpress.com address, so it’ll do.
Jekyll was surprisingly easy to get started with. I was a bit worried as a bit of Ruby-phobe, but even for someone who doesn’t know anything about Ruby it was easy to get started. Getting my old posts out of WordPress was straight forward, and they were easily converted into Markdown. I spent quite a bit of time tidying up the generated Markdown, fixing broken links and images, etc, but fairly quickly my new blog was full of my old content.
One advantage of WordPress is that you can hit the big
Publish button and your post is live on your site. Fortunately,
in the 12 years since I started this blog, many things have come along to make automating publishing a static site easier.
Obviously, the first step was to set up a GitHub repository. I have had good success
with Travis CI in the past, and it worked well here too. They provide a prebuilt Ruby image,
rsync. Running the Jekyll builder and then
rsyncing the generated content over to my Linode server on
success was really quite simple to get running.
A key part of being a successful blogger (so I’m told) is to keep posting content regularly. WordPress helps support this
by letting you schedule posts for the future. This way you can have a queue of completed posts, removing the panic of
needing to complete a post by a certain date. Jekyll supports future dated posts, so we just need to be able to trigger
the deployment pipeline automatically to cause them to be deployed. Travis CI makes this easy thanks to its support of cron jobs.
More Options then
Settings for the site’s build pipeline, then towards the bottom is a Cron Jobs section where
you can schedule the pipeline to be run daily.
So far everything had gone a lot more smoothly than I’d expected. Converting my old posts to tidy Markdown took longer than expected, but it was more laborious than difficult. The final thing I wanted to tackle before going live was comments.
Initially, I was quite taken by StaticMan. This service works by providing an endpoint you can point a form to, and it will create a branch in your GitHub repo where it’ll add the comment in the right format for Jekyll. Clicking a button in GitHub to merge the branch will then trigger the deployment pipeline, making the comment visible. Sadly it seems that StaticMan no longer works quite as advertised on their site as the bot has been blocked by GitHub for exceeding API rate limits. They still offer a self-hosted version but given I’m running 1GB Linode server memory is quite tight, and I can’t afford a permanently running Node server.
I still liked the idea of StaticMan, so a quick Python script later and I had it integrated with the GitHub API, and Akismet for spam filtering. It runs as a CGI script, so is only spawned when necessary. The script is in the same repository as the rest of my site, but if anyone is interested in reusing I could separate it and release it. Please let me know in the comments below.
Now I’ve completed the update of my blog, it’s time to get writing. I have a few ideas about what I want to talk about, so hopefully it won’t be a couple of years until my next post.