codeflood logo

Eleventy Migration

Back in 2018 I migrated my blog from WordPress to Hexo. Hexo is a static site generator running on Node.js. At the time I chose Hexo because it allowed me complete control over the structure of the resulting website, plus I could override and tweak the markup of the resulting pages. Hexo is a fairly fully-featured static site generator. It has a lot of functionality built into it to cover a lot of what many people will want in a blogging platform including things like code syntax highlighting, CSS pre-processing, embedding content from external sites, etc. However, all that functionality brings with it a lot of dependencies.

At some point (I think it was in 2022) I attempted to upgrade to a later version of Hexo, but it didn't work. I can't remember what the exact issue was now, but I recall after I updated the Hexo version and let it pull in whatever updated dependencies it needed, my site would no longer generate. This upgrade attempt was triggered when I was writing a number of posts with GraphQL samples in them, but the version of the code syntax highlighting library used in the version of Hexo I was stuck on didn't support GraphQL, although a later verison of the library did. I attempted to update the code syntax highlighting library alone, but that caused huge issues with the dependency graph. This was a perfect example of why minimizing dependencies is so important.

Also in 2022 I was exploring Next.js. The thing I really liked about Next.js is how constrained it was out-of-the-box. Next.js is a framework for buiding websites and applications and it doesn't impose anything in terms of site structure or markup. In fact, you bascially get nothing out-of-the-box. And I really liked that. Architecturally my site wouldn't be requiring a bunch of dependencies for functionality I might not even use. I considered using Next.js to rebuild this site, but the thing I didn't like about Next.js was the fact it ran too much client side. After all, it is a framework for building React applications, which are native JavaScript. But in the case of my blog I don't need a dynamic application, I just want static markup output.

Eventually in January of 2023, I happened upon Eleventy when Khalid Abuhakmeh started tooting about it on Mastodon. Eleventy just felt right to me. Like Next.js it was very scant out-of-the-box, in a good way. The constraint it exercised meant I got to choose exactly what dependencies I wanted to take on. It wasn't trying to add all the bells and whistles it could, and in turn, push more dependencies onto developers. So when I want to use an external library to add some functionality, I'm in control of the version of the library I use.

Earlier this week, I finally completed migrating this site from Hexo to Eleventy. Eleventy has a really strong and positive community built up around it. I found myself referring to many existing blog posts from the Eleventy community as I built out all the functionality I was using in Hexo into my new Eleventy site.

So if you're searching for a static site generator, I would highly recommend having a look at Eleventy.


Leave a comment

All fields are required.