My attempt to convert from Jekyll to Eleventy

submited by
Style Pass
2021-10-19 16:00:10

Usually when I write something, it’s because I’ve figured something out, or done something for the first time. But, that’s like 1% of the things that happen. In this case, I thought I’d try out Eleventy, and see about converting my site from Jekyll. After getting stuck on all kinds of weird things, I gave up. I questioned my career choice. I stared longingly out of a window. I ate bread. So, this isn’t really a conversion guide, but more of a report? There are things here that are likely obvious to others, or there are things here that probably should be better documented.

This part was super easy! I’m familiar with node, and all that entails, so installing Eleventy and configuring it was very straightforward. It felt like a great fit. With that done, I began running into issues. The first was surrounding the templates. Eleventy expects them to be in a folder called _includes, but Jekyll wants them to be in a folder called _layouts. Thanks to this article by Alex Pearce, I found I could just modify this with a setting in .eleventy.js (a file that must be created).

Now that the layouts were looking in the right place, I stumbled around trying to get them to be applied appropriately until I found out (from this article by Kitty Giraudel) that each “collection” in Eleventy uses a configuration file in their directory to apply this across the board. So, for my “posts” collection, I added a file called _posts.json, and added the following.

Leave a Comment