Eleventy, understanding yet another static site generator
Eleventy is a static site generator that is feature rich and yet focuses on simplicity and rapid builds. Compared to Astro, Gatsby, Jekyll etc. Eleventy can build pages a maginitude faster making it an ideal chose for websites that want to host large number of statically generated pages.
Mozilla moved from Jakyll to Eleventy long time ago and wrote a blog post. This was a classic real world scenario where even Mozilla did not know how much performance gain to expect. Yet, when they ran it they found that while Jekyll took 10+ minutes to build, Eleventy did it in 3 seconds. Yes. That fast.
What was immediately apparent was how fast Eleventy is. The entire site was built in under 3 seconds. That is not a typo; it is 3 seconds not minutes.
Eleventy is fast and lightweight. It is a replacement of Jekyll which means it plays really well with Jekyll sites with minimal changes. Also unlike Gatsby, Eleventy is extremely simple. You basically give it a directory full of templates and data and its does the rest. It can work with any templates including liquid, mustache, Nunchuks and what not. It can integrate seemlessly into you Nextjs or Vue app as well.
The steps to get started are extremely simple. All you need is nodejs installed on your machine.
You can create HTML templates or mardkdown files as templates.
This comment will generate the templates.
Eleventy and Jekyll are pretty much alike, except that Eleventy is lot more faster. Jekyll however is lot more popular and is around for a much longer time. If you have a site that is lot larger and you are currenly using Jekyll please consider moving to Eleventy.
Gatsby is more flexible react based static site generator. It is primarily designed to fetchdata from API and then generate files based on that though it can also work on markdown and other templates. However Gatsby is extremely slow and can not scale beyond few thousand pages in reasonable build time.
Nextjs is a full fledged framework to build applications. It does support static site generation. However, Nextjs and Eleventy aren't meant to replace each other. NextJS is suited for building large scale apps and not just static sites but Eleventy is purely for static sites.
Criticism of Eleventy would be same as criticism of many static site generators. Static site generators generate ton of repitative HTML and pages which are easier to serve but are static and hence can have limited features. In many cases a simpler, server side rendering might be simply better.
If you are considering Eleventy, chances are you are looking at generating sites that have thousands of pages. Nothing wrong with that but a question you might ask is why not have a PHP or NextJS based static site generator for the same ? The cost difference is not going to be very much if you ask me.
Eleventy is yet another static site generator but indeed is better than many existing choices and most certainly worth using for its high performance compared to Jekyll.