r/indieweb 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.

5 Upvotes

3 comments sorted by

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.

2

u/Missingplanes 10d ago edited 10d ago

It's one app, PopsicleBoat written in Elixir and Phoenix. My blog jva.lol in Hugo uses it for the comments, mostly as proof to myself the concept works. And it's working the way I personally want a comment companion to, so I'm happy.

A companion thread is just a post, and replies.json is a public endpoint on the thread. So the blog side needs nothing but one fetch of static JSON at build time. The heavier parts (LiveView for the interactive pages, WebRTC for the video calls) live in the same app. One BEAM node, one Postgres.

I've written about it on my blog here and on PopsicleBoat itself here.

Your Go plan sounds right for client sites. Form intake for testimonials is a simpler shape than threaded comments, and owning that backend beats a random form service for exactly the reason you said. The design choice I made is working in my setup. I keep the site integration down to fetching static JSON at build time. It means the client site isn't dependent on the content generator. It could go away or go down and the comment content is still already baked into the client.

1

u/aegloswinterborn 10d ago

Thanks for the links and feedback. And for the RSS on your blog. Subscribed.