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 translated 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.
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:
- 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.
- When you want to write another post or page, copy the folder of an already existing post or page and edit it.
- 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
Published by John Ankarström on 2019-06-19.