Comments on a Static Site (sans Javascript)

📌 Late June 2021
June 30, 2021

Static Sites are Great

You can host your static site for free (well, for just the price of the domain registration) on a variety of platforms, including Netlify, Cloudflare Pages, or GitHub Pages. This blog is a static site. (For information on the tools used to create this site, check out Tech Notes: How This Site was Made .)

Why comments?

We have email – it’s a great tool and can enable communication between a blogger and their readers. But most visitors to a blog are not inclined to reach out by email. For better or worse, the popularity of social media and commenting solutions like Disqus are what people are used to, and having a form at the bottom of a post to submit a comment is pretty much expected these days.

Why not Disqus?

It’s easy for a blogger to add a Disqus comments section to their blog. But unfortunately it’s a privacy nightmare and includes ads unless you pay up.

Disqus Alternatives

Cusdis seems like a pretty good solution. (The name’s similarity and inversion of “Disqus” is intentional.) You drop in a tiny bit of Javascript (~5KB compressed) into the bottom of your blog’s template and bam, you now have a comments section!

Cusdis is what I would use if I was less of a purist. You see, I don’t want the comments to live on someone else’s server; I want them to be a part of the post itself so it can live on decades from now, long after any individual commenting platform has died. I also don’t want to include any third-party Javascript code on this site (again, for purist reasons) so this makes a Javascript solution less attractive. (I could host Cusdis myself on my own server, but it’s more complex than I want to deal with – it would seem to defeat the purpose of having a static site in the first place.)

The Solution

Forms. Yes, an old fashioned HTML <form> that submits its contents to a URL via a POST request. You get the comment by email, weed out any spam, and then manually update the blog page.

How do you do that without your own server? There are a bunch of options, from Netlify Forms (didn’t like the autocharge for exceeding the free plan’s limit, though) and a whole slew of website forms companies that have a variety of plans (and limitations on the free plans).

After a bunch of research I settled on formsubmits.com. It’s free and really easy to set up. I even set up my static site generator to include a hidden field with the current post’s link, so when a comment arrives in my email I always know which post it’s about.

December 2023 update: I’m now using https://www.staticforms.xyz/ to process my comment forms.

Of course manually updating a static site with comments could become tedious if you have a high volume of comments, but for a low-traffic personal blog it works just fine.

Other Options

  1. Zoho Forms: A lot like Google Forms, but not from Google. You can build a form with a custom “Thank You” page redirect for free. Deep in the form’s settings there’s an option to add URL parameters that automatically fill a field, so you could, for example, link to forms.zoho.com/mysite/myform?post=JuneUpdate to autofill a (probably hidden) “Post” field to fill you in that the comment is about the “JuneUpdate” post. There are a bunch of embedding options, too, including plain HTML with no Javascript, but unfortunately the free plan does not allow you to use a custom redirect for the “thank you” page.

  2. Other companies similar to formsubmits.com: most of them have limits or involve putting Javascript on your site. I won’t list them all here, since they mostly didn’t fit my needs and the offerings will probably change, anyway, but as of 2022 some of the other top options were airform.io, form-data.com and formsubmit.io

  3. Set up a serverless function on to accept comment submissions: It probably works great, but setting it up involves more complexity than I’m looking for in a handmade website.


Comments

No comments yet.