how this site is built

this site is one go program and a folder of files. there's no database, no login, no comments, nothing that has to keep running somewhere, and i'll try to explain how that works without making it sound fancier than it is, mostly because it's less fancy than it sounds.

the program

it's written in go using mostly the standard library, which sounds like showing off but mostly means there's less to go wrong. the only extras are goldmark, which turns markdown into html, and chroma, which colours code blocks on the server so the browser doesn't have to. the pages come from a few templates: one main layout, and then a small template for each kind of page.

where the content lives

blog posts are plain markdown files with a title and a date at the top, then a line with three dashes, then the writing. a portfolio project is a folder with a project.md in it and the pictures it uses, and the folder name becomes the address, so a folder called vr-noir-swarmer ends up at /portfolio/vr-noir-swarmer. i like it this way because adding a project means dropping a folder in, with no list somewhere that i have to remember to update. the program fixes the picture names in the text so they point at the right place, and it only hands out files that are actually pictures in that folder, so nothing else in there can be fetched by guessing. the gallery is a small json file listing each picture with a caption and a description, and the icons in the footer come from another json file, where an icon only shows up if its address is filled in. if something in any of that is wrong, a missing picture or a bad date or a folder name with a capital letter, the program says which file and what's wrong, which i'd much rather have than a blank page, and while i'm working on the site it keeps showing the last version that was fine.

links that don't reload the page

htmx does the navigation. when you click a link it fetches the new page in the background and swaps only the middle of the screen, so the menu and the ascii name stay where they are and it feels quicker than a full reload. the back button still works. alpine, the other library, handles two small things: it marks which menu item you're on, and it shows a line saying the page didn't load if a request fails. those two are all the javascript on here, so if something moves, one of them is why.

no server

there's nothing running behind willevlab.party, which sounds like a trick but isn't. the same program has an export mode that asks its own router for every page once and saves the answers as plain html files in a folder, along with the pictures and the stylesheet. cloudflare serves that folder. renting a server was an option too, but i like money too much.

keeping it locked down

every page is sent with a content security policy, which tells the browser it can only load scripts from the site itself and from the one place htmx and alpine come from, and only styles from the site. htmx is loaded with an integrity hash, so if the file on that cdn ever changed the browser would refuse it. blog posts can't contain raw html either.

the look

there are no image files in the design and no web fonts. the text is whatever monospace font your system has, the yellow and the dark background are a few colour variables in one stylesheet, the little social icons are inline svg, and the ascii name at the top is just text that shrinks to fit the screen. the whole site, pictures included, comes to under a megabyte at the moment. it took a few tries to get the look right, something like six redesigns. the first layout was so close to another site i'd been staring at when i started that i said so myself and started over. after that came a cyberpunk 2077 version, which i chose because it's my favorite game.

if something here is broken, my email is on the about page.

click anywhere or press esc to close