⟵ Home

Comments in a static world

· 9 minutes read (≈1680 words)

Update #1 (February 26, 2020)

I added a comment form that sends me an email with your comment. Nothing fancy and without any automation at the moment. But at least it’s an obvious way to gather feedback from my readers.

Update #2 (March 02, 2020)

I received an email with the first comment from one of my readers! Yeah..

Comments are, in my opinion, a great way to get feedback from your user. But having user generated content on a static site like this blog here is a challenge. Most people with static blogs reach out to 3rd-party providers. There are plenty of vendors out there. SaaS or self-hosted - the fact remains: Either your site is no longer completely static or you give up some freedom.

Option 1: Using a SaaS provider

It seems to be convenient to use an external service and embed some magic <script>-tag to your site and call it a day. One of the most mentioned services Disqus uses this method. It will probably cost you some small amount of money regardless of which hoster you use. Nothing expensive. Maybe some simpler ones will also have a free tier with limited functionalities. But the real price you pay is the loss of control over the user experience and, far worse in my opinion, the control of your own data. The data of your users. The privacy of your users. If that is not already enough, you will also be on the mercy of the vendor. If (or more likely when) they close or increase their prices you could lose all your valuable comments. This is definitely not an option for me.

Option 2: Self host a comment system

Self-hosted solutions like Isso or HashOver help to get back control over your data and look and feel. But now you have to manage databases, have a lot more components to update regularly and the most important thing: You are no longer completely static. And here goes all the advantages of a static site down the drain.

Option 3: Off site discussion

Another alternative is to use external discussion platforms like Twitter, Mastadon or Reddit. You have more or less the same disadvantages as using an external comment SaaS provider; maybe minus the price tag. This is probably an okay-ish solution if you already have a community built up on other platforms. Otherwise, I don’t think having the discussion decoupled from your actual articles is a great thing.

Option 4: Off site discussion with fancy “import”

Besides the privacy problem of using an external 3rd-party service, this is probably one of the better solution. You use another platform were your users post their comment and then import these comments directly into your static website. Either with some fancy web hooks, cronjobs or manually. Even if the platform goes down, all your old comments are still available directly visible for everybody beneath your blog article and without calling some external JavaScript.

This is IMHO probably one of the best solution at the moment. The external service could be something like Github issues or a Google Form. You just have to link your readers to the site where they can post a comment. Implementing a automated import should be mostly straightforward. The only problem could be Spam and illegal content. But moderation will always be a problem.

I’ve been thinking about this for a long time. There is no question that you need an external service if you want to keep your site completely static. Either 3rd-party or self hosted. So I thought: Is there any communication channel that every online citizen has and that everybody can use? Yes, there is! The good old E-Mail.

Is a 30 years old protocol a solution?

E-Mail is old. Really old. The history goes back half a century. After all, the modern mail system is about 30 years old. Nonetheless, it’s going strong with over 3.7 billion users and around 300 billion sent and received mails per day1.

I’m quite sure that every visitor of my blog here has an email address. Probably even multiple mail addresses. On the receiver site, you can self-host your own mail server or you can use another provider. Of course, the mail server itself is a complicated piece of technology. Hosting a (simple) dynamic CMS system is in fact easier than maintaining a mail server. But because everyone already uses a mail server anyway, there is no extra effort necessary.

I personally think this is definitely a valid and quite good solution.

How to use it?

It’s really simple. Just put a small sentence on the end of your articles and explain that you are receiving feedback via E-Mail. At best, add a mailto-link that your readers just need to click on to open their favourite mail client.

A little bit more advanced would be an HTML form that automatically opens the mail client with prefilled subject or body text. The subject should probably reference to the name of your article. Such form could look like this:

<form action="mailto:someone@example.com?subject=article-slug" method="post">
        <legend>Your comment:</legend>
            <input type="text" name="name"> 
            <label for="name">Name: </label>
            <input type="text" name="mail">
            <label for="mail">E-Mail: </label>
            <textarea name="comment"></textarea>
            <label for="comment">Comment: </label>

After receiving an E-Mail, you have to update your static website yourself. Depending of your site generator, it should be fairly easy to set this up. Since I am using zola, I will most likely write an update or a new post about my experience implementing it with zola later on.

It there a way to automate it?

Yes! Reading mails from a mail server is quite easy due to standard protocols like IMAP. I could imagine a feature in my build pipeline that pulls the latest comments from a mail server and integrate them directly into the generated static html site. It could run as a cronjob or I could trigger it manually.

As soon as I find some spare time, I will implement all this. Let’s start coding!

  1. Source: http://www.radicati.com/wp/wp-content/uploads/2017/01/Email-Statistics-Report-2017-2021-Executive-Summary.pdf 

Leave a Reply

Your reply is send via email. If there is any problem with the form below, then you can simply send me an email with your reply to blog@jdsoft.de as an alternative.

Your email address will not be published.

$ whoami

Show less Show more

I'm Jens Dieskau, a software developer, infrastructure operator, tinkerer, and wannabe designer from Germany. Before I do a handshake three times, no matter how easy and fast it is, I prefer to automate it right away. I am not afraid of new technologies and challenges. My home is the shell. My tools are ssh, vim, tmux & co. Code that is not in a git repository does not exist for me. I love and live open source software and there is hardly any technology I have not looked at already at least once. Besides programming, I have in-depth knowledge in areas like virtualization, networking (LAN & SAN) and in operating server applications of all kinds.