1 day ago · Tech · hide · 0 comments

I’ve migrated my static images to use Cloudflare R2 as my object store and image CDN. R2 exposes an S3-compatible API, which makes it nice and easy to use the aws CLI to interact with the bucket. Previously I was (ab)using GitHub’s free image CDN via their user media upload support in Issues (https://github.com/user-attachments/assets/<hash>). However, this is slow and not very idiomatic. For R2, I’ve attached the bucket to my public sub-domain, so raster images are now served from cdn.abstractnonsense.xyz and should load much faster. I’ve also migrated my inline-footnote Hugo Markdown render hook from overriding image-links to overriding regular-links. Now, relative image paths are prepended with the CDN. The publishing workflow still involves manually uploading images to the desired path and ensuring the Hugo path reflects it, but I might make this more ergonomic in the future. I’m thinking about building a folder-add triggered Shortcut on my macOS that’ll take care of the bucket…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.