Thefoggiest.dev

“Why yes, I do have the foggiest”

Homebrew blogging engine

April 16, 2024

"When you want to bake an apple pie from scratch, you have to invent the universe first" (Carl Sagan)

Perhaps you've noticed, but this blog won't greet you with a cookie warning anymore, because it doesn't use cookies anymore. There is also no need for you to spin up your browser's JavaScript engine, because this site is 100% pure html plus css. Everything here is cooked server side and served to you perfectly statically.

under contruction banner

The reason is simple. I've ditched WordPress and built my own platform instead, which was surprisingly easy. The result is that I have much more control and it uses less electricity, both at my end as at yours. To compare, for me, this page takes 217 ms to load on this site, while its counterpart on my old WP site took 849 ms, and that one didn't even have the picture. That is a good difference and one I'm very happy with.

Git and JSON

Of course, my own code allows me to use all my own favourite tools. I'm using git for version control on the content. That's good, because I noticed that I tend to write posts ahead, so I can read them again a week or so later and make a few corrections that I didn't see I needed earlier.

It also means this site will be perpetually under construction, as it should be. Right now, there's no search, you can't click on category or tag names, and webmention and pingbacks don't work yet. It won't need spam protection, because all it does is show static content. Also, you might need to re-subscribe to the RSS feed. Sorry for that.

I have a git hook set up on my server that will push the file to the right folder. Posts are in fact HTML files with a JSON header, like this:

{
	"title": "Homebrew blogging engine",
	"date": "2024-04-16",
	"categories": ["blog"],
	"tags": ["python", "css", "code"],
	"summary": "Introducing my new blogging engine!"
}
<article>
<p>content</p>
</article>
The meta data allows me to create the archives an categories on the left and sort them by date. It also allows me to push files to the server before their publication date.

Zen

I've been using WordPress since I started blogging in 2006. This is because it seemed a good option back then and after my blogging hiatus of the last few years, it was easiest to restart by re-downloading WP, let it adjust the old database and then merrily go on blogging. But since that hiatus, cookie warnings became mandatory, on-site discussions stopped happening and comment spam therefore became 100% of my comments.

I've been looking at a dozen other solutions, among them Hugo, Poet and WriteFreely, and they fell, more or less, into two categories. On the one hand I found platforms focusing on SEO as much as WP and often just as bloated. And then there were those that were very minimalist and felt like a lot of work or didn't allow for pictures. In neither category I found exactly what I wanted, mostly because nothing ever made me feel like I was in control. Minimalist is good and feels zen, but then I'd rather use my own code instead of having to pull in mesmerising amounts of node modules and go through some steep learning curve made up by someone else.

So I've creating my own, from scratch. Well, not entirely from scratch, there was already a universe, python template libraries and everything in between. I made it look like my old WP theme for now, but I will probably change that.

Categories: blog

Tags: python, css, code

CC-BY-SA 2006-2024 thefoggiest.dev