Use bikeshare to get around? Make sure there are always docks where you’re going, and bikes when you’re leaving, with
This site is now generated using Jekyll, and hosted as static HTML on Github Pages. Yay!
A history of how we got here
Years ago, my site was a wholly custom PHP piece of garbage. From it I learned a ton, but I was relieved when I finally took the time, maybe 4 years ago, to rewrite it.
Then, for about a year, it was a Rails application, with a very minimal UI for editing posts. I was too lazy to really improve it, and the only improvements needed were the CRUD UI.
So I rewrote it again, but kept the views and routing, using a gem I wrote called mumblr. Mumblr was simple: fetch content from Tumblr, cache it locally, and the use it as content on your site.
For example, instead of building any kind of CRUD for the landing page, I just needed to make the landing page show content for any post tagged with, eg,
mumblr_landing_page. Then, I need only post on Tumblr a single, private entry, with the content I wanted.
That worked pretty well, but made it really difficult to see what I was getting without trying it out in production. Worse, Tumblr would periodically change the fields that came back rom
There was one problem with my Mumblr set up that was far worse than any others: I was wholly dependent on Tumblr, and hosting a Rails site is much more complex than a static HTML site, which my site mostly was.
- If Tumblr went down, I had everything cached locally in Mongo. But I couldn’t update anything, and Mongo takes up tons of storage, and grows incredibly fast.
- If Tumblr were to get acquired by someone else, then I’d have to migrate everything somewhere else.
- Hosting a Rails site requires lots of moving parts. No big deal, but minor things like updating SSL get much more complex with more moving parts.
- Static HTML is blazing fast, and can be heavily cached.
On top of all of this, I’ve been going through a dependency-diet for the last few years, where any dependency that isn’t very necessary is a very bad thing.
Why did I need a gem to install bootstrap? Why do I use a gem to include font-awesome? Why do I even use bootstrap?
Jekyll + Github Pages
Enter Jekyll. (Well, actually, enter a revolutionary idea I had a few months back to create an application that would generate static HTML from easily-maintained content. Oh wait, that already exists? Jekyll? Interesting.)
Now, all my posts are stored in a github repo in a universal markdown, allowing me to either grab the generated site or use the markdown if I ever get tired of Jekyll.
I only need to install three gems locally to test changes before deploying them.
And if I need to make a change while I’m out and about, all I need to do is make the change via Github’s web UI, or ssh into any machine that has git and my ssh keys installed.
It wasn’t all sunshine and roses. Github pages doesn’t support SSL with a custom domain. And I want both a custom domain and to encourage people to stop trusting sites served over only http. So I had to setup CloudFlare, and thus change a bunch of my DNS records. (Worth it.)
I also had to setup redirects for all my old posts, because Tumblr throws an ID in the route, which I’ve never liked. Fortunately, github pages supports
jekyll-redirect-from, a simple redirect plugin.
Finally, I had a few things on my existing site that weren’t static. For example, you could search blog posts by tag. I could easily write something to generate a page for each tag, but I kind of prefer my existing solution of listing the (few) posts by date in the archive.
Anyway! Hope you enjoy the faster site, and the small changes that came with it!