fucked up the relative path in RSS feed text
I think Smudge stole that 'd'.
Smudge stole the 'if'. Bad kitty.
rock operatic science fantasy (and more) by Matthew Graybosch
This is not only my personal website (currently hosted at starbreaker.org, naturally) but an exercise in using a Unix-like system as a content management system and a static site generator using raw HTML instead of Markdown, Org mode text, or some other markup language that needs to be converted to HTML before publishing to the Web.
Rather than use a conventional CMS like WordPress or Kirby, or a SSG like Jekyll or Hugo, or even systems like Eleventy or Astro, I’m using a makefile and a bunch of shell scripts that use standard Unix tools like m4, find, xargs, cat, cut, grep, sed, and awk.
If you’re on a reasonably functional GNU/Linux system, you should already have the following installed:
Additional dependencies include the following:
If you’re on Debian and friends, you will need to install build-essentials
and m4
along with packages for the additional tools with apt.
If you’re on MacOS or a BSD, you’ll want to install GNU tools with homebrew. If you don’t, none of my scripts will work for you. You are, of course, welcome to adapt my scripts and makefile for use on a BSD system without GNU dependencies if you like.
Create a new directory under sources/
where you want the new page to live.
In that directory, create index.html
and index.txt
.
index.txt
should contain the following shell variables:
PAGE_TITLE=""
PAGE_DESCRIPTION=""
PAGE_CREATED=""
PAGE_MODIFIED=""
PAGE_TEMPLATE=""
PAGE_PATH=""
PAGE_EXTERNAL_LINK=""
PAGE_PREVIEW_IMAGE=""
PAGE_PREVIEW_ALT=""
PAGE_PREVIEW_TYPE=""
PAGE_PREVIEW_HEIGHT=""
PAGE_PREVIEW_WIDTH=""
The PAGE_CREATED
and PAGE_MODIFIED
dates are in RFC-822 format.
Whether you use times in UTC or local time is your choice.
PAGE_TEMPLATE
is the name of a HTML template in the templates/
directory, without the .html
extension.
PAGE_PATH
is a relative path to the website’s root.
This ensures that hyperlnks work both on the server and offline.
PAGE_PREVIEW_*
is for people who give a shit about social media.
You can write any kind of HTML you want in index.html
using the editor of your choice.
I favor GNU Emacs, but my tools will work whether you use vim
, ed
, or even Visual Studio Code or Sublime Text.
I have tried to adhere to traditional makefile conventions.
make
to build the website.make clean
will work as expected.make install
will (at least on my computers) deploy the site to my host. Running make install
won’t you do you any good unless you update sshvars
with your own hosting details and use valid SSH keys.make text
will build everything but images.make help
to get a list of all available targets.I make use of recursive make so that I can control the order of operations while still taking advantage of concurrency in make
where it makes sense to do so.
make
.website/index.html
in your favorite browser. It should work in both text-mode browsers like lynx, w3m, and EWW as well as graphical browsers like Firefox and Safari. (It should also work in Chrome, but Google doesn’t pay me to use their browser at home.)I built my website like this because I could, because I wanted to, and because only God could stop me — and He damn well knows better than to try.
While I can tolerate PHP (and my tolerance rises with the salary offered), I loathe JavaScript, Node.js and friends, and the npm ecosystem. I would prefer not to touch it outside of my day job. I regard Douglas Crockford’s JavaScript: The Good Parts as a fantasy novel, because JavaScript doesn’t have any good parts. Besides, why in Crom’s name do I need hundreds of npm packages just to build a blog?
Also, I figured that since I’ve got irreparable brain damage from exposure to Unix in college, I might as well put those skills to use in my own service.
Besides, I like shell scripting, and bending make
to my will was an interesting exercise.
Likewise, I like the idea of using tools that date back to the 1970s to build a website in the 2020s.
Like heavy metal, Unix is still a vital force over 50 years later. Nor do I think it’s a coincidence that the first version of Unix and Black Sabbath’s first album both dropped in 1970.