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.

WordPress WorkFlow

I’ve been using WordPress for a very long time, this site was built in 2004 and I think it was on version 1.2, and was using WordPress from around mid-2003 on other sites before that.

wordpress-1-2

So a long time.

Much has changed, but WordPress has proved remarkably robust, I just spun up a theme I built around 2005/2006. See the code here (please forgive some of the code, this was 11 years ago. ) and it still works! The Loop is still the same crazy Loop, that I am never sure I fully got, anyway the point being if I had installed a theme from 2005 it would still work today.

2016-11-24-at-12-42

So pretty amazing and points to why WordPress was a good solution 10 years ago and is still a good solution now, we don’t talk about longevity much in web development, but I like to know something I build now has a shot of existing 2, 5, 10, or even 20 years from now.

Sure we now have custom post types, custom taxonomies, rest API and some amazing plugins that turn WordPress into a fully fledged CMS, but at it’s core it’s the same easy to use, easy to develop on and easy to recommend system I first installed all those years ago.

Now my own workflow has changed a bit, whereas back in the day all I needed was a copy of WordPress, Dreamweaver! (Code View & FTP) and maybe Photoshop.

These days it’s a bit more involved, this is what I tend to start most new projects with, on average I reckon the setup is about half a day, give or take:

Code

WordPress plugins

Applications

Anyway, thanks WordPress

1269602956_dr-mccoy-and-captain-kirk-approve

2020 2019 2017 2016 2014 2013 2012 2011 2010 2009 2008 2007 2006 2005 2004