Using 11ty

I've been using 11ty for a bit now, and I'm absolutely going about it an objectively bad way; I am reading the docs as little as fucking possible. This is because I'm Like This, the docs are fine.

But despite knowing as little as I can get away with, there's very little I've struggled with. It's a nice static site generator. The general directory structure of my project is like this:

src
├── _includes
│   ├── main_layout.md
│   └── sub_layouts.md
├── art
│   ├── img
│   │   └── various.png
│   └── index.md
├── assets
│   ├── css.css
│   ├── js scripts.js
│   └── favicon.svg
├── blog
│   ├── posts
│   │   └── first-post.md
│   └── index.md
├── works
│   ├── fates-fabric
│   │   └── ...
│   ├── heartsmith
│   │   └── index.md
│   └── index.md
├── about.md
└── index.md
eleventy.config.cjs

Then to build the site, I just need to run the npx @11ty/eleventy command. It takes this file structure and makes it into the whole site.

It also has a --serve flag that can be used to run a server with a file watcher included, which is always nice.

It's very flexable, I remember with Hugo I was a little frustrated at needing to use their directory structure, and that might have been something about the theme I was using I'm not sure, but with 11ty you can put your assets wherever makes to you and by default any file that's not something that can be rendered into a HTML page is ignored until you tell it to pass it into the site and wear to pass it into the site.

It's also nice in that if you want, say, solkind.red/about to exist you can just have an about.md file in the top most directory it serves, you don't need to make about/index.md, which keeps things a little cleaner imo.

It can chain layouts, you can apply a layout to a adirectory and all its subdirectories or overwrite that for a single file, you can make collections of pages and loop through them, there's a breadcrumbs plugin that's pretty nice, so far the thing that bugged me the most is the default date rendering is very verbose and rendering a date as a string took a little fiddling with.

Overall it's simple to use, has most features I want out of the box, and is easy to add features to, especially if you know basic coding. I've been enjoying it! Would recommend to anyone looking into making a static site.

Back