Switching from Jekyll to 11ty

| 3 min read

Despite talking about how and why everyone else should write a blog, I have clearly ignored my own advice and instead spent time switching this blog from Jekyll to 11ty, a JS based static site generator. It was fun to mess around with 11ty and Github actions, and it gives me something to write about.

NOTE: I originally wrote this around Sept/Oct '21. I've been playing with eleventy internally, but only just got round to pushing and publishing Jan '22.

Why change from Jekyll

There's no right or wrong software to use in most cases. I feel a good piece of software shouldn't get in the way. Jekyll can get in the way by being quite slow as a result of being bloated with age. In Jekyll's defence, it was also largely my own lack of time and patience for Ruby that contributed to the change.

Jekyll was nice when it worked, but I had a few different issues getting it to build with certain plugins and settings in Github actions vs my local machines, and fixing often found me Googling basic Ruby stuff.

I spend my personal and professional time nerding around - I know how much I don't know, and I don't know Ruby. It's probably not hard to learn, but I just don't want to have to learn it right now.

Why change to 11ty

I do a lot of writing and note taking in markdown, and 11ty is also a markdown based static site generator, like Jekyll.

I write a bunch of Typescript and Javascript for my day job. It's not my favourite language, but I'm more fluent in it than most other languages these days. 11ty is written in Javascript, so it all feels a lot more familiar to me. It's also a lot quicker, lighter, smaller and easier for me in general compared to Jekyll.

11ty is also one of the newer static site generators, and I like shiny new thing.

For the indecisive: running Jekyll and 11ty together

Just in case I wanted to go back, I extracted my 2 - 3 posts from Jekyll into a separate folder outside the Jekyll hierarchy. I then setup eleventy-duo and symlinked the posts folder in there. In github, I now also have 2 actions: one which builds Jekyll, one which builds 11ty, set to build when either CMS or posts are updated.

name: Eleventy

on:
workflow_dispatch:
push:
paths:
- eleventy*/**
- posts

(I also include workflow_dispatch in most actions so I can kick them off via github UI if needed.)

I was hoping to be able to get them both working flawlessly together, I created separate Github Action workflows for Jekyll and 11ty, triggering each on changes to its own folder. However, minor differences around post handling thwarted me: I had to manually move the post dates from the filenames into the frontmatter for 11ty.

It probably is possible to get 11ty to use Jekyll's post dates, or vice-versa, but I'd already decided I preferred 11ty - and it was hardly a vast anthology of posts to manually update - so there was no need to get the Jekyll side working. I might pick it up again later if I try another static site generator.

Conclusion

11ty powers this blog now. It's faster and newer than Jekyll, and a lot easier if you're familiar with JS. Ultimately, both are markdown based static site generators, so it's easy to migrate. It's probably possible to have a fully working hybrid where the same set of content markdown files power a few different static site generators to see how they compare, but that's overkill here, for the time being.

I'm starting to feel like these sorts of migrations and tech stack swaps are almost a right of passage for anyone exploring static site generators - especially for a personal blog!