Eleven Reasons to Love Eleventy
On November 29th I gave a talk at the CambridgeJS meetup on a favourite topic of mine: the static site generator Eleventy. I gave it the listicle-adjacent title “Eleven Reasons to Love Eleventy” but I didn’t go to great lengths to declare what each of these were.
Slides and notes from my presentation are available but I wanted to spell out the bones of my talk and record the magnificent Eleven for posterity.
Simple & Flexible
Unlike other static site generators, Eleventy supports many template languages out of the box. My preference is Nunjucks, a reasonably intuitive language to do a sort of meta-programming on top of whatever file you wish to generate.
Eleventy allows you to use a blend of different templating languages in one site. One benefit of this flexibility is that it makes the process of migrating over from a alternative generator a cinch: you can “progressively” migrate content and formats as needed.
Eleventy pagination makes it easy to split collections of materials into chunks for your site. It can also be used to create multiple outputs for the same input – I use it to generate OpenGraph images for social sharing and email markup for my newsletter.
Underpinning every Eleventy configuration is a flow of data from a variety of different sources and blended together according to a hierarchy of inheritance. For the best summary of what this means check out Ben Myer’s full coverage.
Eleventy doesn’t care about the other libraries and tooling you may wish to use. There are countless starter templates covering a wide variety, from Gulp to PostCSS, Tailwind to Vite. As an extra bonus many of these have full marks over on Google Lighthouse.
There are a wealth of fantastically useful plugins for Eleventy. Many plugins are official ones solving real problems in convenient and modular packages.
The documentation and ethos of Eleventy prioritises and promotes accessibility when building websites. Official plugins like Inclusive Language normalize considering accessible language when writing content for an Eleventy site. As per the documentation (emphasis mine):
It’s very important that we take responsibility for the code we publish and deliver and strive to correct accessibility issues with the same veracity as a full service outage.
I’m a nosy web browser – whenever I come across a site that impresses me I reach for one of my favourite Firefox extensions: Wappalyzer. This takes an educated guess at the technologies used to build sites. A site built with Eleventy will have very few “tells” that give away it’s generator and it’s invariably the fastest sites that don’t have anything in their Wappalyzer results.
On the other (server) side – Eleventy builds are very quick to run and will provide pointers if particular configurations start to slow down the build.
My experience with the Eleventy ecosystem is that of collaboration and camaraderie in the name of making great websites. The Eleventy community Discord is friendly and the regular Eleventy meetups are supportive and welcoming.
Finally I find that the documentation and general ethos of Eleventy is fun – from the reassuring possum mascot to irreverant humor sprinkled around the documentation.
I like to say that Eleventy sites are “hand-crafted but not by hand.” By being in full control of the process outputs it’s fun to build sites that have everything you need and nothing you don’t.