DEV Community

Winston Puckett
Winston Puckett Subscriber

Posted on

Introducing: 11ty with reasonable defaults

TL;DR

Initialize your 11ty projects with reasonable defaults:

  1. npm install -g yo
  2. npm install -g generator-eleventy-reasonable
  3. yo eleventy-reasonable

https://github.com/winstonpuckett/generator-eleventy-reasonable

What and why is this?

I had a problem. I love 11ty. I've used it for years now to create most of my front end. It's simple and powerful and I can always get better performance than with most other frameworks.

As I've used it, I've developed a toolchain around it. 11ty is bare-bones (as it should be). I found that I install the same HTML/CSS/JS minification in every new project I create. I always have a similar file structure and similar needs to extend 11ty. In the past I've forked my projects or copy/pasted when I create a new one, but this approach bothered me.

I wanted to abstract all the complexity of setting up a new 11ty project.

What features are included?

  • Runs npm install to always start with the latest versions of dependencies
  • Minification on build through html-minifier, clean-css, and terser.
  • Sets up standard 11ty folder structure (_includes for include-able files and _assets for files to copy to the server).
  • Sets up a default nunjucks template and wires in a default CSS file.
  • Default template has a number of good meta tag suggestions and sets up an emoji favicon (something I've appreciated).
  • Default CSS file is in dark mode in case you're coding late at night.
  • With only a few short files, it's easy to see what needs to be updated and removed.
  • Sets up a build and serve script in the package.json file, so you can run npm run serve to work with the project.

Can I use this for commercial projects?

Absolutely! The project is under an MIT license. And if you're using it for anything cool, I'd love to hear about it!

Where can I find out more info?

Top comments (1)

Collapse
 
Sloan, the sloth mascot
Comment deleted