DEV Community

Discussion on: What is your favorite Static Site Generator and why?

Collapse
 
hunsalz profile image
Markus Hunsalz

Thx @webbureaucrat for mentioning 11ty. I tried myself in the past. But I have to be honest 11ty didn't catch me. It's been too long ago that I could state the actual reasons. - Do you have 3 main reasons to win me back for 11ty?

Collapse
 
webbureaucrat profile image
webbureaucrat

Oooo fun challenge

Simplicity

A lot of static site generators come with way too much out of the box, which makes for a steeper learning curve without much benefit. I tried Hexo, for example, but the whole "themes" thing just didn't make sense to me ("Can't I just write some CSS?") Or elm-pages, which, as far as I understand, compiles to static pages with javascript rather than separating those concerns. I can't wrap my head around it. Or the many static site generators which are built around React, specifically.

Pluggability

I love that the configuration is itself a script file because it means you can just import an NPM package and start using it. It makes it easy to switch templating engines or markdown compiler or even write your own ad hoc extensions.

For example, I wanted the ability to sort my blog tags by number of articles under them so that I could highlight the topics I write about most frequently. It's basically one line in the .eleventy.js file:

    /* takes the collections object and returns a list of tags sorted by 
     * how many articles it has. */
    eleventyConfig.addFilter("byImportance", collections => {
        return collections.tagList
            .sort((tag1, tag2) =>
                  collections[tag2].length - collections[tag1].length
                 );
    });
Enter fullscreen mode Exit fullscreen mode

That's the kind of thing where, if it were any harder to do, I probably wouldn't have bothered.

Development Status

Eleventy is in a stage of project maturity that I think is the absolute sweet spot for adoption. It's young enough that it's iterating rapidly and isn't weighed down by any legacy burdens, but it also just went 1.0 and got sponsorship from Netlify and has a broad enough user base where you can ask questions and get answers.

This also means that if you looked at it before, it's not super surprising to me that it didn't impress you. It's matured a lot in just the past few months.

Feel free to have a look at my blog's source or fork it if you want, though I recommend deleting the scripts/ folder and full-build.sh, which are my front-end scripts and the script that compiles them, respectively. (I'm doing some really cursed things in a language called ReScript in there that I would definitely not do again.)

Thread Thread
 
hunsalz profile image
Markus Hunsalz

Wow, really an impressing answer!

Actually, I can understand why you favor 11ty over other SSGs now. - Simplicity can be a strength and combined with the easy expandability it's a sharp sword to solve problems. Next to that the maturity level speaks for itself.

Next time, I definitely will look at Eleventy with other eyes!