~starbreaker/starbreaker.org

website for my sf
9757e0d3 — Matthew Graybosch 16 hours ago
fucked up the relative path in RSS feed text
1694f453 — Matthew Graybosch 18 hours ago
I think Smudge stole that 'd'.
2d90ec50 — Matthew Graybosch 20 hours ago
Smudge stole the 'if'. Bad kitty.

refs

main
browse  log 

clone

read-only
https://git.sr.ht/~starbreaker/starbreaker.org
read/write
git@git.sr.ht:~starbreaker/starbreaker.org

You can also use your local clone with git send-email.

#starbreaker.org

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.

#Dependencies

If you’re on a reasonably functional GNU/Linux system, you should already have the following installed:

  • GNU make
  • GNU coreutils
  • GNU bash
  • GNU m4
  • GNU sed
  • GNU awk

Additional dependencies include the following:

  • HTML-XML-utils (command line HTML/XML manipulation tools from the W3C)
  • exiftool (read and alter EXIF data in images)
  • cjxl (convert JPEG and PNG images to JPEG XL format)
  • avifenc (convert JPEG and PNG images to AVIF format)
  • cwebp (convert JPEG and PNG images to WebP format)
  • rsync (deploy to remote hosts over SSH)

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.

#Creating new pages and posts

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.

#Building and Deployment

I have tried to adhere to traditional makefile conventions.

  • Run make to build the website.
  • Running make clean will work as expected.
  • Running 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.
  • Running make text will build everything but images.
  • You can run 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.

#Offline Reading

  1. Run make.
  2. Open 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.)

#Rationale

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.

Do not follow this link
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy