Website Details
The last time that I actually built a campaign website was more than a decade ago, and it was all painstakingly hand-crafted XHTML (!) and CSS, most likely edited in Emacs, running on a LAMP-ish Linux server also custom built for that purpose. Given that we're a few years down the line from that world, I thought I'd try some fancier build-and-deploy tooling.
Here are some details on the content technologies in use:
-
I'm using the Zola static site generator, mostly because Zola is written in Rust and Rust is my current fascination-of-choice for tinkering around with in the evenings and on weekends.
-
Zola in turn relies on the Tera templating framework, which is fairly feature-complete, reminiscent of Jinja2, and has my preferred framework characteristic of not continuously getting in my way as I'm working with it.
-
The actual page content pages in Zola all gets written in the venerable-but-still-the-best Markdown language, which has great editor support and remains stubbornly easy-to-read in native syntax in Emacs (yes, I still use Emacs).
-
The templates-plus-content get rendered through a custom "Grifter" theme that I developed for the website; Grifter uses the UIkit front-end framework to do all of the heavy lifting. I will confess that I went through more than a dozen different CSS and JavaScript frameworks as I tried out early versions of this site, from very basic to very complex, and every one of them quickly annoyed the hell out of me except for UIkit (but time will tell).
(As an aside: no one where I work is likely to let me use Rust for anything serious, even if I were allowed to write code in the first place these days. But if you're an old systems programming dog like me, I highly recommend checking out Rust, and pushing through the first hundred hours or so of confusion and frustration with the very different idioms and toolchain idiosyncracies -- out of the ten or twenty new-ish programming languages I've messed with over the past ten years, Rust is the one that really feels like it's found my sweet spot. And after fifteen years living mainly in interpreted or byte-compiled platforms, it feels really, really FAST.)
As the content gets written, it gets pushed through the following deployment toolchain:
-
On my (Mac-based) local environment, I'm old-school Emacs and iTerm2 for basic editing, directory management, etc. I preview changes using Zola's built-in local web server functionality.
-
Everything lives in version control in a local Git repository, with an upstream origin repository in Github -- private for now while I have some gamemaster notes-to-self sprinkled around the content, but no reason it couldn't be made public once I clean it up a little bit.
-
I use the SmartGit GUI tool for repository management, branching, commits, etc., occasionally dropping down to the command line if the tool doesn't want to do what I want it to. I have it configured to use the "simplified" (feature branches only) version of the GitFlow branching model, for which SmartGit has good support.
-
Any new commits on the master branch (which usually only happen when I do a rebase merge to finish a feature branch) trigger a deployment job in the CircleCI continuous deployment service. That job builds out a customized Docker environment, installs the appropriate prerequisites, then checks out and builds the updated branch.
-
The penultimate thing that CircleCI does (assuming no errors) is deploy the generated website to an AWS S3 bucket configured as a static website hosting endpoint.
-
The S3 bucket is configured as the origin for an associated AWS CloudFront distribution which both farms out the content to the world at large, and also enables it for secure access via an AWS Certificate Manager-provisioned SSL certificate. Note that the very last thing that the CircleCI workflow does is send a blanket cache invalidation notification to the distribution, so that the new content becomes immediately visible.
-
Last but not least, I set a CNAME alias record in my DNS service, currently hosted by TierraNet, to put the user-friendly "maddogs.white-knight.org" site URL on the content.
All of the above took about a week to set up correctly, with most of that just being learning and trial-and-error (since it's been a while for me, and a lot of the tools are new or have changed). The actual deployment process (from when I merge a feature branch) takes less than five minutes to complete while I go get another cup of coffee. Given the low traffic you'd expect from a small personal site, the entire thing costs me a dollar or two a month, which I pay for by not buying a cup of coffee when I want one, once a month.
Now that I have my toolchain all sussed out and a good set of notes on the twitchier bits, I estimate I could replicate all of the above for another website in much less than a day.
This is the part where you can insert the cranky-old-man-voice rant about kids today not understanding how hard it was to do all this stuff back when dinosaurs and neckbeards roamed the earth.