Building a personal website

Creating a place to publish my projects and ramblings

Home

The revival

4 of 4

Hello, it's been a while!

Rethinking the whole thing

I really wasn't happy with the state of this site. It was too complicated, half-finished, and frankly I never posted anything on it.

Azure wasn't working for me

  • Firstly, the ongoing costs for such a simple blog didn't really make sense. I have a lot more experience in deploying and managing websites than I did two years ago, so even though Azure is certainly cheap (this site was costing me less than £1 a month to run) there's just no reason to host it on someone else's computer with all the bells and whistles. I can do this myself for free.
  • Secondly, the free tier of Azure Functions has terrible availability which I could never work around fully, so the site worked sometimes when the API was running. Perhaps this is partly my fault anyway; I wanted to have an API for the sake of building one. Does a blog need an API? Absolutely not.

My goals have changed

Two years ago I was looking to build something fancy to impress all the potential employers who would drop by and look at my blog, and it was very job-hunting-focussed. Right now I just want a place to dump all my thoughts, so the goal is to simplify. For what it's worth the site does get around 500 hits a day, but I assume this is mainly from bots/web crawlers rather than people legitimately interested in reading whatever this is. Let's be honest, this is a personal blog, and the main audience is myself. If you're not me, hi! Hope you enjoyed the daft physics toggle on the homepage.

The new philosophy

  • I'm not putting my CV on the site, because I'm not looking for a job right now and also who cares?
  • I'm not building a CMS because again, who cares? I am the only user, and I can just update the code.
  • I'm not building an API for data or images - this is a static site, and I can just redeploy to make a new post.
  • I am going to make it fun, though, because I want to actually post here and enjoy doing it.

The stack

The site you're on right now is running on a Raspberry Pi Zero, plugged into a USB port on my desk. It's small, power efficient, and perfectly capable of serving static files.

A very small web server plugged into a USB port

This is running Raspberry Pi OS with Lighttpd as the web server, and there's a cronjob to auto-renew the TLS certificate with Let's Encrypt's API.

Files are deployed using Samba - I have the docroot mapped as P: (for Pi) on my laptop, so my deploy script simply drops files in there. Easy peasy!

The site itself is now built using Sveltekit's static site generation rather than Next.js, which I've seriously enjoyed using. Svelte is incredibly familiar coming from React, while feeling somehow much more concise and predictable. The resulting build is smaller too - it's less than a couple of megabytes and that's mostly images.

I write articles in markdown, and these are parsed using Marked. Metadata such as the title and date are stored in an accompanying json file. All of this gets compiled down to static HTML.

Oh, and finally the physics toggle on the main page works! Try it on mobile - it responds to the accelerometer. This is using Matter.js and was an enormous pain to get working. Why? I dunno. It's fun.

What now?

I used to lay down future development plans at the end of my posts, but these often change, and besides it's much more interesting to talk about what's actually been done. So for now I'll just say I want to post more. Whatever is interesting to me at the time.