It's done. The whole site runs on Eleventy now. Every page, every post, every little silly billy fiddly-bits (the stats, mostly)... all of it goes through the build pipeline and comes out the other side as flat HTML. I don't have to edit four different places like a caveman for some small superficial detail anymore.1
tl;dr
Hand-coded static HTML -> Nunjucks templates + 11ty.. shared layouts, blog post collections, data files, the works. I do my own little slugs.
why 11ty
When in the Course of human events, it becomes necessary for one people to dissolve the bands which have connected them with another... they've got to figure out what compiler to pick. I knew on the outset that I could NOT hardcode blogposts anymore. Anyways, here's what I've figured out:
Hugo is fast but the templating felt alien.
Astro is cool but heavier than what I needed.
11ty is out of the way. Muahaha.
Feed it templates and data and it gives you a site. You put stuff in, stuff comes out. Since I like the way I do things, I want to keep the way I do things. Waow.
what actually changed
- Layouts: one base layout, page-specific blocks. The navbar lives in exactly one place now so I don't need to change everything forever and ever.
- Blog posts: markdown files!!! I love Markdown. I use Obsidian a lot and I'm tired of doing "<i>" instead of doing "_text_" It's a
.md file. 11ty turns it into a forum thread and I don't have to touch the HTML.
- Data files: project lists, changelogs, all that stuff lives in
_data/ and gets "compiled" at the build time, so, again, I don't have to edit the HTML.
Were there things that broke along the way? I'm not really sure.
the things that broke along the way
Everything. Everything broke and I was miserable. THe only thing that DIDN'T stop me from completing this migration was the fact I had intentionally designed the blog in such a way that it would be easier to migrate to 11ty.
Paths were wrong for a while. The blog index template had a filter issue that took longer to find than it should have. Asset paths needed adjusting because 11ty's output structure is slightly different from "a folder full of hand-written HTML files."
The guestbook admin page is still raw HTML because it doesn't need templating and I'm not going to pretend it does.
was it worth it
I don't know. The site was getting to the point where every small change meant editing multiple files and hoping I didn't forget one. Now I edit a template or a data file and the whole thing rebuilds in under a second. Adding a new blog post is just creating a markdown file. Adding a new project is just adding an object to a JS array. But... now I can't claim the site to be a simple static site anymore. I've got a fat, chunky site. Miserable, that situation is.
The migration itself was a few days of work, but the payoff is already obvious. I can actually iterate on things now without dreading the manual labor. waow
tip
If you're running a small personal site and it's all hand-coded HTML, you don't NEED a static site generator, really! Until you add a Blog portion to your site, a Musings section to your site, a Projects section to your site, a yaddayaddayadda section...
But i think the REAL 11ty migration was the .njk we made along the way :-)
- 1.
- I was, in fact editing small, superficial details across six files like a caveman :-(