RSSAmplifier

Blog

Blogs on Duncan Mackenzie

Recent content in Blogs on Duncan Mackenzie

duncanmackenzie.netRSS feed ↗10 posts

Latest posts

Adding Bluesky likes to my Hugo based blog posts

I read Salma Alam-Naylor’s post about how she added a cool feature to her blog posts and decided to replicate it exactly onto my Hugo site. This feature displays a list of Bluesky accounts that liked a specific post (her public post linking to the article), right on the page. There isn’t much for me to explain about the code, you should read her post first to understand what it is and how it…

Using the correct autocomplete attribute value on input fields

One of my common past times is viewing the source of web pages using ‘Inspect’ in the browser. Often I’m doing this to fix a problem, such as removing readonly from a field I need to change, deleting an onpaste handler to allow me to paste some text in, or even just putting the value I want into value to get around odd form restrictions. Other times though, I’m just curious…

My software developer origin story

Over the years, many people have asked me how I got started into software development and I have told the same story every time, but I realized I’ve never written it down. So, for anyone who might find this interesting or useful, and just to put it out into the world, here goes. Back when I was in high school, in the 1980s, my parents purchased a Commodore 64 (C64). This wasn’t specifically for…

Adding llms.txt & markdown output to your Hugo site

If you’ve been online at all for the past year, you will have been hearing about LLMs (Large Language Models) and AI assistants non-stop. I’m not going to be talking about those systems or products here, but in the end, they are all relying on being able to pull content from the web, your content for example. If you or your company want your content to be accurately ingested by these…

Homegrown Analytics

I must start with a quick disclaimer. Replacing the near-universal web analytics with your own is not the right path for most people. What I’ve made is nowhere near equivalent, it involves writing my own code, any analysis I want to do is all on me, etc. If you are here because you want to remove GA from your site, you could try one of the more popular alternatives like Plausible or Piwik .…

Handling duplicate events from Stripe in your webhook endpoint

In my recent post, detailing how I handle order fulfillment for my Stripe integration , I missed an important part of reacting to Stripe webhooks. The documentation explains that your endpoint may be called multiple times for a single event , but I don’t handle that in my code. It also points out the ordering of events is not guaranteed, but that doesn’t matter in my case since…

Visual Regression Testing using Playwright and GitHub Actions

This last weekend I was visiting my mom up in Canada, and she asked me for the URL to my website because she wanted to see all my recent photos . She brought it up on her laptop, and for the first time in months, I saw my site in ‘light’ mode. And there was a flaw in how some of the text was rendered. I, like many developers, have been only doing the simplest form of testing, which is to view my…

Adding prefetch and prerender using the Speculation Rules API

We were brainstorming on performance improvements at work the other day, and I remembered I always planned to add some form of prefetch/prerender to my site. Prefetching is making a network request for a specific URL from the current page, with the idea that if the user visits that URL next, it will already be in their local cache and load faster. Prerendering is the same idea, but taken farther,…

Adding sharing to my posts via ShareOpenly

Just a quick post introducing Ben Werdmuller’s ShareOpenly tool, and showing how I added it to my site. I saw Ben post about this on Bluesky , read his great intro article about it , and decided I wanted to add it to my site. I’m planning to use it in a few places, so I started by making a partial that takes the current page as a param. {{- $description := .Site.Params.description -}}…

Order fulfillment with Azure Functions and Stripe

In the previous articles in this series, I covered how I added photo galleries to my site , and then how I enabled a feature to buy the original digital photo . The last piece (for now at least) is how I automate delivery of those high-resolution images, so that everything should just happen without any manual steps. There might be a better way to handle this, but after reading even more pages on…