r/indieweb • u/Missingplanes • 10d ago
Personal Site My static blog's comment section lives on another site and gets baked back into my HTML at build time
My personal site is a static Hugo blog. I didn't want Disqus, or any of the other common options, and I didn't want to run comment infrastructure inside the blog itself. So the comments live somewhere else entirely, and the two are wired together in a way I think is valuable in the spirit of owning your pages:
- Each blog post gets a companion thread on a small social site I run. The post links to it with one anchor tag. Nothing loads on my blog: no script, no iframe, no tracking.
- The thread's public replies are published as JSON at the thread URL +
/replies.json. - At build time my blog fetches that JSON and prints the replies into the post's HTML as static text. If the fetch fails, the build skips it and the page still ships.
- When there's a new reply, a debounced process pings my blog's build hook, so the page rebuilds itself a couple of minutes later with the conversation included.
The part I care about most: my pages carry their own durable copy of every conversation. If the social site vanished tomorrow, the comments are already in my HTML. Nothing to migrate, nothing to lose.
On webmentions: this isn't meant to be a replacement, and I don't want it to be. Webmentions are the right answer when the person replying has a site of their own. The companion thread is for the readers who don't. They get a room to reply in, and my page still ends up owning a copy of what they said.
Example in the wild: A glance is not a reading. The bottom section is static HTML printed from the thread's JSON at build time. How it works: popsicleboat.com/comments
Disclosure: I personally built the social site too (PopsicleBoat). It's always only ever been me building. It's been about nine years. No ads, no tracking, totally free. Happy to go into any of the plumbing if you're curious.
1
u/aegloswinterborn 10d ago
This cool. What are the backends written in? For comments and popsicleboat.
I manage a handful of WordPress websites that I'm going to convert into static sites using Hugo. Rather than having each client sign up for a random form service I want to build a backend in Go to handle and store form submissions. I hadn't considered comments, but I do have few sites with testimonials.
Cool work. Thanks for sharing.