Hello!

Like most projects I do, I started making this blog because I thought it would be fun and interesting. I have a few ideas for posts about other projects I’ve done or things I’m interested in, so I guess I’ll just see how it goes.

To start, I thought I’d just give an overview of how I made the blog. The site is made with Jekyll running the Hydeout theme with a few tweaks. Jekyll is a static site generator, which essentially means that the site is written in a combination of Markdown and HTML templates, which are rendered into complete HTML files on my laptop before being uploaded to the web server.

And speaking of web servers, this site doesn’t really have one! The site is served using Cloudflare Workers Sites, which means the site content is stored in Cloudflare’s global eventually-consistent database and served from whichever Cloudflare data centre is closest to you. I’ve written a little Python script to let me easily run various combinations of the Jekyll and Wrangler(Cloudflare’s Workers CLI) commands.

Besides styling, there’s two main additions to the base theme I’ve made, the first of which is the rainbow bar across the top, which I adapted from pride.codes, and the second is the Spotify widget in the sidebar on desktop, or in the homepage header on mobile.

Music is a massive part of my life, but I often feel a little embarrassed sharing it. I guess because of that (or maybe because I just like playing with APIs 😝), I wanted to add a widget of my currently playing song. Luckily the Spotify API is extremely well documented and altogether very nice to interact with – thanks Spotify! The pages of this blog use JavaScript’s fetch to pull a JSON response from a Linode, which runs a PHP script using jwilsson’s interface library. The JS also uses the cool ColorThief library to pick a background colour for the widget out of the album artwork.

If I wanted, I could also run the Spotify integration directly in the Cloudflare worker, but I already have the Linode running for other things, so it’s essentially free to just add on the Spotify script, whereas the extra request volume being handled by the worker would probably push me into the paid tier sooner or later – not that I really expect to get much traffic 😂

Comments