mckinley.cc Home Blog Notes Twtxt

XML: The Future (of mckinley.cc)

June 3rd, 2023

My entire website is now valid XHTML 1.1. Why? More on that later. I've been wanting to do it for a while, but Ladybird crashed if you tried to feed it XHTML. Yesterday, I realized that's no longer the case, and began work on the migration. It took 13 Git commits, a push to live, some fiddling around with .htaccess on the live server after I broke everything, another commit, and one final push before I realized that Ladybird was no longer applying my CSS.

As a matter of fact, it wasn't picking up any element with a self closing tag e.g. <hr />. Those elements simply did not exist when checking the inspector. When I thought everything was working before, I was looking at a cached copy. Rookie mistake.

Self-closing tags work as expected if the page is normal HTML, but the same page as XHTML will have those elements missing. There's a good chance I'm the only one on the planet who will run into this issue. However, if you do, it can be worked around by using a separate closing tag, e.g. <hr></hr>.

Now, onto why I've done something so ridiculous. Up until now, my website has been mostly valid HTML 5 with <!DOCTYPE html>. It was "mostly valid" mainly because I like to use the tt element which has been deprecated.

Despite using the HTML 5 doctype, I have always attempted to stick to what's available in HTML 4.01 and CSS 2 for one simple reason: A text-based website, especially one that looks like this, shouldn't require the latest and greatest software. I haven't always stuck to those specifications, but I have maintained decent support for Lynx, Netsurf, and, more recently, Ladybird.

It's also been a sort of protest, in a way, against the New Web and the never-ending "Living Standards". Yesterday, I formalized both of those reasons by switching to XHTML.

I was originally going to switch to HTML 4.01. I ended up choosing XHTML because it isn't forgiving like regular HTML; tiny errors in markup will make browsers refuse to display anything. This will help me keep my website valid and in line with the specifications.

The switch also allows me to use XSLT directly on my pages, which will open up possibilities for automating things around the site. For instance, I should now be able to automate the changes to my home page every time I add a post to my blog or twtxt feed. Rather than edit it manually, I can regenerate the entire page with an XSLT stylesheet. It will be like a static site generator, but worse.

Anyway, I'm hoping nobody will notice the change unless they read this post. All old file locations ending in .html will have a 301 redirect set up indefinitely, and every internal link on the site has been updated. It took an awful lot of find, sed, and git add -p to get here, but we made it in the end.