Writing HTML in HTML

I've just finished the final rewrite of my website. I'm not lying: this is the last time I'm ever going to do it. This website has gone through countless rewrites – from WordPress to Jekyll to multiple static site generators of my own – but this is the final one. I know so, because I've found the ultimate method for writing webpages: pure HTML.

It sounds obvious, but when you think about how many static site generators are being released every day – the list is practically endless – it's far from obvious. Drew DeVault recently challanged people to create their own blog, and he didn't even mention the fact that one could write it in pure HTML:

If you want a hosted platform, I recommend write.as. If you're technical, you could build your own blog with Jekyll or Hugo. GitHub offers free hosting for Jekyll-based blogs.

Now, there's nothing wrong with Jekyll or Hugo; it's just interesting that HTML doesn't even get a mention. And of course, I'm not criticizing Drew; I think the work he's doing is great. But, just like me and you, he is a child of his time.

That's why I'm writing this blog post – to turn the tide just a little bit.


So what are the benefits of writing HTML in HTML?

There's one less level of indirection.

This point is simple, but hugely important.

Using a static site generator means that you have to keep track of two sources: the actual Markdown source and the resulting HTML source. This may not sound too difficult, but always having to make sure that these two sources are in line with each other takes a mental toll. Now, when I write in HTML, I only have to keep track of one source.

Further, you actually need to have your static site generator installed. Again, not a huge thing, but if you often switch between different operating systems, this is yet another chore. With HTML, you just need a web browser – which, if you're creating a website, you need anyway!

Finally, you constantly have to work around the limitations of your static site generator. Let's say you want your site to have a specific directory structure, where pages are sorted under various categories. With Jekyll, this is practically impossible, and even though you technically can get it working if you really try, it is only through much effort and with a source code that is organized much more unintuitively than if you just wrote it directly in HTML.

These seemingly small things tend to add up, and when you know that there are three or four extra things you have to think about before you write another blog post, there's a higher threshold to start writing.

And that's something that I've noticed: with nothing but pure HTML, there is no threshold. When I used a static site generator, I always had to do a dozen small things – start the auto-refresh server, research how to do something – before I was ready to do anything. Now, creating a new theme, a new post, a new page or even a new site requires no setup – I just open up a HTML document and start writing!

So what's the catch? There has be some reason why people don't write their personal websites in pure HTML. Well, it's simple:

HTML is unpleasant to write.

This is the only real reason. And it's true – HTML is a pain to write! But the solution, I argue, isn't to use other languages that are then trans­lated to HTML (we've seen above how many problems that causes); the solution is to use better editors.

The best HTML editor I've found is actually the WYSIWYG Composer part of Seamonkey. As long as the source is HTML 4.01 (which, for a personal blog, is surely sufficient), it can edit any HTML document. It's what I'm using right now to write this post, and despite its age and a couple of quirks, it works really well.

Screenshot of SeaMonkey's Composer. Click for full size.

Another very promising alternative, which isn't WYSIWYG, but more of a WYSIWYM editor, goes under the name HTML Notepad.

If you don't want a WYSIWYG editor, I'm sure that modern IDEs have reasonable support for HTML.

In any case, once you start writing a post, you'll notice that it actually isn't so bad, as long as you have an editor that is more modern than vi (no offense to vi users – I use it as my main editor myself).

Doesn't this mean that I have to type a bunch of boilerplate every time I create a new blog post?

My simple answer is: just copy it. My more advanced answer is this:

  1. Make blog posts and pages self-contained – in other words, have each post or page reside in its own folder, with its own scripts and stylesheets.
  2. When you want to write another post or page, copy the folder of an already existing post or page and edit it.
  3. If you find the previous step too much work, write a shell script that copies the directory and removes the old content for you.
But how can I then keep the style and layout of all my posts and pages in sync?

Simple: don't! It's more fun that way. Look at this website: if you read any previous blog post, you'll notice that they have a different stylesheet. This is because they were written at different times. As such, they're like time capsules.

Update (October 2020): I've now updated the design of the entire site (mostly), because some pages had style sheets that depended on modern CSS features and were incompatible with older browsers – so you won't really see any time capsules if you explore the site, at least for now.

In summary, I don't think this post will convince everyone – and it's not written for everyone. It's written for those who have found themselves in the same situation as me: regularly rewriting their website, fighting with their static site generator. For these people, I think pure HTML is the best choice.

Read more: Response from Lobste.rs


 
Learning C as an
uneducated hobbyist

(previous article)
Is Zoom really
that bad?

(next article)

Comments  •  Submit

Nemo Null
Submitted on 2021-12-08 01:12
Are you using html minifiers and brotli compression? This could make your page *the most responsive site* ever.
Joel Cares
Submitted on 2024-01-14 17:01
I love writing plain HTML.

Another static site generator to throw in the mix:
https://www.11ty.dev/

It's pretty easy to control your folder structure, you can work in plain HTML if you want to, and all of the extra utility is optional. Keeps everything simple and has tools available when you need them (ie simple templating and file based data storage).
Rishikesh
Submitted on 2024-01-15 10:01
Great article
MK
Submitted on 2024-01-15 18:01
All of your complaints, of course, apply equally to compilers. Or rather, I should say *other types of* compilers, since a "static site generator" is a compiler, albeit a relatively simple one for a non-Turing-complete language.

Think of all the problems that us schmucks using compilers have to deal with. Source files and object files are more to "keep track of". We need to have a compiler installed on every computer where we want to work. We have to work around the limitations of the language and compiler. Life is pretty tough when you aren't allowed to just write your program directly in machine language!

65 years ago, this was "The Story of Mel", and it's a foundational myth of the field. We admire this person, even though I haven't heard of anyone writing any program in machine language in 40 years.

At a time when LLMs are making some question whether humans will have any job left writing source code (or English), you've chosen a very specific rung on the ladder of computational abstraction, and refuse to budge. It's a little nutty and yet somehow admirable. Take a proud seat next to those writing Commodore 64 web servers, and Gameboy demos that will only ever run in emulation! You've earned it.