Static is … static

Ever since moving this blog to the Hugo static site generator, I’ve been looking for a way to add comments to the site without resorting to one of the popular commenting services of yore.

The challenge is that this is a static website. All the pages you see here are static HTML — flat files created by Hugo SSG — with a bit of CSS and JavaScript added. This approach keeps the site very lightweight. But I confess my primary motive for this move was to get away from the unending cycle of code upgrades needed for WordPress and, before that, Drupal, which was becoming something of a part-time side career even after I left the web design/development business.

I just want the site to work — ideally without resorting to pre-canned SAAS solutions. And definitely without having third-party ads plopped all over the pages.

The downside of having a static site is that it takes a bit more work to integrate it with other platforms.

The Fediverse is expanding

I first joined Mastodon several years ago. Actually I joined several instances, checking them out. It was a fun distraction for me at a time when things in my personal life were rough. But the activity level there was limited so I drifted away, leaving my accounts dormant.

When I returned last November, I found that some of the instances I’d had accounts on had disappeared. Another account on a still-running instance was summarily deleted at some point; I never received a notice, I just figured it was because I was not around. And of the three accounts that remained viable, one was on an instance that wasn’t being moderated or even maintained (running code several releases behind the current).

Anyway, to make a long story short, I still have two accounts dating back to 2017. But most of my activity is on Wandering Shop.

Connecting a static site in a dynamic Fediverse

I got very excited when I came across Carl Schwan’s blog post on adding Mastodon posts as comments on his Hugo site. Drawing from code so generously shared in his post, plus additional thoughts by Veronica Berglyd Olsen in her follow-up post and a Mastodon thread, I was able to implement using Mastodon/Fediverse posts as comments that appear underneath my blog posts here.

This integration is not as simple as simply adding a plugin to your WordPress site. There are really only three steps:

  1. In Hugo, create your post and publish it.

  2. In Mastodon, post a link to the blog post.

  3. In Hugo, update your post’s front matter to specify the Mastodon ID of the post linking to the blog post, and publish the update.

You now have Fediverse posts serving as comments on your SSG posts.

NB: While the details may differ, this same kind of integration can work with other SSGs besides Hugo, using other Fediverse platforms besides Mastodon.

Anyway, what do you think? Have you done something similar on your SSG? Please comment so more of us SSG site owners can reach out into the social ’verse!