Nunjucks and rediscovering web development

So I am still very much love WordPress, I even had a cold embrace with Gutenberg (no React for me though, I strictly follow the three important rules that must never be broken: do not expose the mogwai to light, especially sunlight, which will kill it, do not let it come in contact with water, and above all, never feed it after midnight, ACF all the way for me💪) but the entire WordPress 5 tug of war did get me thinking, I really don’t need to be so wedded to one CMS or even a set method of building sites.

For some time I had considered static site builders (*again*, I used to build sites in Movable Type). And given I didn’t have to learn React I could learn something else I actually wanted to do and not pipe 400kb down the pipe before rendering 1 line of HTML (and lets face it WordPress is not ideal here in the first place). Obviously the CMS part was the reason I build so many websites in WordPress in the first place, but not all websites need a CMS. I’ve build many CMS’ for people that thought they needed the ability to edit their site, and probably never logged in to it (and sometimes just ask me to update stuff, because they don’t know what to do or the interface has changed way too much 😜). So I figured why not static, more secure, faster, and I get to get back to what I really love crafting websites mostly in HTML/CSS and a sprinkle, Salt BAE style, of Javascript.

I’ve been playing around with Handlebars, Jekyll for a bit and liked them, and then found out about Nunjucks (can’t remember where, but I knew Gov.uk used it for their site). Really liked it a lot, I’ve been using npm/Gulp for a number of years, and many different template engines/systems, so felt comfortable using it, hell WordPress is one of the best right, but also used liquid, django and probably others that are gathering dust in a SVN repo somewhere.

I liked the fact it was like hand coding a site, but on steroids, I could hook it up to a JSON file like a lightweight CMS and generate all the pages I needed, I could use even markdown files as content as well (with the addition of a package). Set off a gulp task and HTML pages came out the other side of the npm machine, like a website factory with lots of little AI helper bots, with myself in an upstairs office looking on.

It also allowed me to concentrate more on accessibility and performance, something I really care about, often with WordPress sites, there were a ton of external dependancies and code that I just can’t control. It also allowed me to create something open source, which I don’t do enough.

So the end point of all this chatter was a little static starter kit called juckWonder (geddit?) that I will use as a starting point for small static sites I need to build. The code is available here on GitHub. I intend to keep on developing and improving it, but pretty happy to where I’ve got with it, I even managed at one point to achieve the holy grail, 💯 across the board on a lighthouse test. Oh yes. Performance doesn’t always return 100 but it’s on a Github pages instance so I wouldn’t expect it to.

So in a roundabout way I am pretty happy WordPress development moved away from me, I got to embrace other parts of development I missed.

Leave a Reply