When I saw this post by Natalie (opens in new tab) on using Bluesky for comments, I knew I had to give it a go. It combines two things I love: playing with APIs and adding features to my site that I'll never use.
They're using Astro, and I do too, but they're using React for the components, and I use Solid. So I had to rewrite things. I could have just thrown it at an LLM, but that kind of defeats the point of having a personal site, right? So I did it myself.
I'm using the atcute (opens in new tab) library to handle pulling the data from Bluesky, which is really nice. The AT protocol can be a bit complex, so getting fully typed data is a big help, especially when I'm dealing with optional fields and different types of posts.
Now obviously, in the full spirit of "features I'll never use", I had to account for all the possible combinations of posts and embeds within those posts. Which means regular text posts, posts with images, posts with links, mentions within posts and posts with links to other posts including any images or links they have.
I especially like the way mentions are displayed, so I've made that a separate component that can be used anywhere. Here's me: Paul J.
As for all my other hard work, maybe it will be on display below this post.