I recently took upon the challenge to write three blog posts a month for the next six months describing various technologies and experiences in software development. This required a blogging platform and with the sea full of options available, I had my hands full.
Several great free web applications provide blogging capabilities such as Tumblr and Medium, as well as self-hosted frameworks such as Wordpress. Sites such as Medium are great if you don’t have a personal website already, but as soon as you do you’ll find your web presence is even more scattered. Facebook, LinkedIn, Twitter, your personal site, and now Medium too! It’s just too much. I needed something I could host myself and integrate with my existing personal site. This led me to start fiddling around with a Wordpress installation on DigitalOcean. Wordpress is great and I’ve used it for other builds in the past, but it felt like bringing a bulldozer to the pinata party. I hadn’t a need for 95% of the functionality, nor the size and hosting costs, that comes with Wordpress. This is when I started looking for alternatives. I wanted something lightweight without having to hard-code every link myself. Jekyll was the solution.
Jekyll is a static site generator, which means it generates static HTML documents through the use of templates. The templates eliminate the need to hardcore everything yourself whenever you add new content - a long outdated workflow. Furthermore, having a static site brings many benefits over dynamic-site alternatives. Speeds are greatly improved, because a back-end is no longer needed to process requests; platform size is greatly reduced, because the back-end logic and middleware is eliminated; and hosting costs are minimized, because of the smaller size requirements and eliminating need for a database. Of course there are downsides too. There is no UI to publish through nor the breadth of functionality you may find in Wordpress, but for my needs, I needed neither.
Setting up Jekyll was a breeze. Assuming you have Ruby and NodeJS, just install the Jekyll gem and then run ‘jekyll new site-name’. With that Jekyll has built out the boilerplate directory structure. There are numerous configuration options as well that you can check out here.
With Jekyll setup and configured I migrated my existing site into the framework by breaking out my markup into re-usable chunks, called includes, that I can now re-use. For example I’m using includes for the footer and navigation since they exist on every page. Best of all, the templates I have wrangled allow me to update content in a single location and have those changes propagate throughout the site. Upon adding this blog post, the homepage was updated to display my latest blog post and the new post was automatically listed under the blog page. That is far superior to manually having to update those snippets every time content is added. Now I just needed a streamlined process for deploying my blog posts to my AWS server.
Rather than using FTP to manage my deployments for every new blog post, I took advantage of the s3_website library. The s3_website library provides sync functionality with, as it’s name so clearly specifies, S3 Amazon Web Services. It is easily installed as a ruby gem and once configured through a YAML file allows one to sync files with a single command. Together, with Jekyll and the s3_website library, I now have a lightweight streamlined setup to blog upon. Now for the real challenge - 18 new blog posts..