Moving my website from Jekyll to Eleventy

For ages now, this humble website has been built using Jekyll ā€“ a static site generator ā€“ and hosted on Github pages.

I know very little1 of the programming language underpinning Jekyll ā€“ Ruby ā€“ but the documentation is good enough and ecosystem is big enough that Iā€™ve been able to muddle through.

Iā€™ve added lots of different ā€œcollectionsā€ to the site. I hacked together my own plugin for using ā€œepochā€ time to create the post URLs. Iā€™ve even managed to add fediverse support, in the form of Webmentions.

But the infrastructure is showing its age. As my site has grown in complexity, and Iā€™ve had new ideas, my build times have started creeping up and my almost non-existent knowledge of the Ruby programming language has become a constraint on my ability to iterate the site in directions Iā€™ve wanted.

So whatā€™s the logical response to feeling marginally restricted in iterating a perfectly functional website? Chuck it all away, of course!

The past month or so, Iā€™ve been secretly rebuilding my entire site using Eleventy. And, if youā€™re reading this, youā€™re seeing the fruits of that labour right now!

New stuff!

Not content to merely lift-and-shift the existing site, I of course made things slightly harder for myself and started changing things mid-way through this site overhaul.

Unique Opengraph images on every page

Opengraph images are the images that pop up on social media when you share a URL of a page. Hereā€™s an example of one I most recently used for my ā€˜week notesā€™:

A representation of a calendar with the word ā€œWeek noteā€ and the number ā€œ01ā€ on it.
This looks fine ā€“ but I never liked the fact that I was always stuck at ā€œWeek 1ā€.

Cool enough. But, I thought, what if the date on that calendar automatically matched the date of the week note? What if I could re-use the page headers Iā€™ve already created as the images?

What if, instead of the above, static image, for my most recent week note, Iā€™d get this:

A representation of a calendar with the word ā€œWeek noteā€ and the date ā€œSep 08ā€ on it.
Now my Opengraph images reflect the actual content of the post automatically.

If I wanted that on my Jekyll site, Iā€™d be out of luck. With such little working knowledge of Ruby, Iā€™d have to manually create them. Thatā€™s a massive time sink I donā€™t want.

With Eleventy, though, itā€™s been relatively trivial.

My site now generates two pages of output for every one page of input: the normal page, and then a separate /social/ page which is run through the Eleventy Screenshots API to create the image.

Pretty neat!

A literal glow up

After the great CSS hack-back of 2023, Iā€™ve been slowly adding a little character to my site. Eschewing the austere minimalism, Iā€™ve been adding a little skeumorphism: Post-It Notes, Polaroids, and iPods Nano.2

Now Iā€™m going a little further, and giving a literal glow up to some elements of the site, like the header.

The header menu of my website in a default state; the text is gray and there is no visible border. The header menu of my website in a hovered over state; the bar has a glow around it.
The header menu bar fades into the background until you hover over it, when it pops out with a glow.
When expanded, the glow expands to fill most of the window.

Not sure if I like this change, but Iā€™ll roll with it for now, until I inevitably get bored and change the designs again.ā€Œ

A few gotchas

There were some snags along the way, which might mean Iā€™ve broken stuff (time will tell).

  1. Redirects Aliases: Jekyll has an excellent and robust redirects plugin. Eleventyā€™s community plugin isā€¦ less robust. Iā€™ve managed to make it work, but it took a lot of fiddling.
  2. Dates and times: You a throw pretty much any date in any format at Jekyll and itā€™ll figure out a way to make it work. Eleventy is far more temperamental. The dates must be in YYYY-MM-DDTHH:MM:SS+00:00 format (e.g. 2024-06-31T09:00:00+01:00) or it throws a wobbly and just wonā€™t build.

It took me longer than it should have done to figure out how to resolve these issues; the Eleventy documentation is ā€“Ā generously ā€“ unclear.

Weā€™ll see how it goes

Now Iā€™m done, Iā€™m pleased that everything is working. The site is also 6x faster to build (down to 1s from 6s), so itā€™s blazing fast to work with again.

Fingers crossed I havenā€™t broken anything too badly!

Footnotes

  1. Read: none. ↩︎

  2. Other sticky notes, instant print photos and media players are available. ↩︎