The page that rebuilds itself

Projects
Popsicleboat, Hugo, Netlify

Last time, I added a feature so my blog can print its comments into the page at build time — plain JSON fetched while Hugo (how I build this blog) runs, rendered as paragraphs with no extra JS or any other dependency. The result is that the conversation only gets updated when you deploy. Which is fine if you push daily, and less fine when a good reply lands on Tuesday and your next deploy is Saturday.

Now that is more robust.

The mechanic #

Most static hosts already have the missing piece. Netlify, Vercel, and Cloudflare Pages for instance all offer build hooks — they hand you a URL, and anything that POSTs to it triggers a rebuild.

So I added a field to Popsicle Boat in account settings: your build hook. When a reply lands on any thread you created the hook gets called if you have it set. A couple of minutes later, your site has rebuilt itself, and the new reply is sitting on your page.

The loop, end to end #

  1. Someone replies to a thread.
  2. A little debouncing, it waits about two minutes for the conversation to settle, then POSTs the hook.
  3. The host rebuilds. Your build fetches the thread’s /replies.json.
  4. The page now carries the new conversation — permanent, indexable, in the HTML.

At no point does anything run in a reader’s browser.

This page is the demo #

This post has a companion thread, and my build hook is wired. Reply to it, and the page you’re reading will quietly rebuild and print your words below.

If you run a blog (or any site with a need or desire for comments) and want this arrangement the whole thing is documented at popsicleboat.com/for-bloggers. One link on your site, one URL in your settings, nothing to uninstall.

I’m pretty proud of it, it’s working like magic for this blog. At least to my eyes.

Replies come from Popsicle Boat members. Accounts are required, it’s why there’s no spam. You’ll sign in there (or create an account, it takes a short minute), confirm before it posts, and land right back here after.

512KB Club Orange Team member