I have slowly over the years moved my digital life into the “cloud” - I ditched my server in a closet setup and opted to use Dreamhost to host this site. I also moved to Google for domains and use GMail for email and sharing documents. I moved my personal files to the cloud using Dropbox for online storage and syncing. I use Picasa for backup and hosting of my photos. The list goes on and on… I’m at a point where most of my data is in the cloud, accessible anywhere I can access the web. It’s very nice. All of these applications, except my website are managed by (hopefully) trusted third parties, freeing me to focus on my data and not the administrative
headaches aspects of keeping these systems secure and running.
In an effort to further simplify my life, I have decided that maintaining a cms is too much of a chore. After using drupal to power this site for ten years, I’m tired of applying update after update and the major upgrade process required to move from one major version to the next - even with scripts to automate software updates, the process is not transparent and requires diligence to stay on top of security updates. I no longer wish to be a system administrator and have grown accustomed to having this work done on my behalf. I’ve also contemplated the wisdom of needing a full blown cms for a personal website. Why does my site need to be stored in a database and rendered dynamically each request? I realize most modern cms’s such as drupal can heavily utilize caching to limit the computation required per request, but there is still complex server side code that must execute per request just to serve up one html page! Jeff Atwood of Coding Horror fame made a similar argument and strongly recommended Moveable Type (italics are mine):
What’s Movable Type’s performance secret? For the longest time – almost 5 years – I used the version I started with, 2.66. That version of Movable Type writes each new blog entry out to disk as a single, static HTML file. In fact, every blog entry you see here is a physical HTML file, served up by IIS just like it would serve up any other HTML file sitting in a folder. It’s lightning fast, and serving up hundreds of thousands of pageviews is no sweat.
I considered switching to Moveable Type, but it’s still a piece of software I would have to deploy to my server host and maintain. Instead, I wanted something with the following attributes:
- Zero server-side code
- Simple - little or no html to write each post - Markdown support would be preferable
- Easy to template and extend
Initially, I considered moving to a hosted blog platform such as Squarespace, but I’m not quite ready to give up full control of my website and all the advantages of having a web host. I also considered writing my own system that would read in markdown files, some templates and generate a static website, but I figured someone must have already built something similar. Why re-invent the wheel? After some searching I found jekyll, a static site generator written in Ruby. This system was originally created by Tom Preston-Werner and is used to power GitHub Pages. It is very customizable and fits my needs perfectly. There are even import routines you can use to extract and import your existing blog content from many popular blog/cms software. It took me a day of fiddling to build this new site and figure out the new workflow. There are several example websites on the jekyll project site that are good examples of how you can build your own site. I simply now create a markdown file with contents such as:
--- layout: post title: Reboot --- I have slowly over the years...
The first several lines (between the - - -) are metadata describing what template to apply and the title of the post. Then everything else is the body of the post in markdown (and/or html). I save post files to the jekyll “_posts” folder and issue the jekyll command to update the generated site. This will convert the post files to html, apply the templates and output the results into a specified folder. Then it’s a simple matter of uploading the site to my host www folder. No code on the server, just a plain old static html site. I have some scripts to automate the above steps. When I create or modify a file in the “_posts” folder, jekyll re-generates the site and it’s rsync’d to the server auto-magically: Create file; Save file; Done.
What about comments, stats, rss feeds, etc? You could integrate comments using a third party, such as disqus, by adding their provided code snippets to your template files. I personally have given up on blog comments for now and instead rely on twitter, email, google+ or carrier pigeon for feedback. As for stats, my host provides a nice website statistic tracking application, but I also use Google Analytics and Feedburner. Again, it’s a simple matter of added the necessary code snippets to your template files to integrate those services. Lastly, rss or atom feeds can be automatically generated using jekyll’s templating system whenever the site is re-built. A nice example can be found on GitHub here.
This site is a work in progress, but I think I’ll like this new way of maintaining my site and maybe, just maybe I’ll be more inclined to write more.