Statically generated sites are great. I’m pretty terrible at keeping personal sites updated with fresh content but I’ve always enjoyed generating, theming, and customizing static sites. Jekyll was my first exposure to a static site generator. I was writing a good bit of Ruby in those days. Fast forward to Golang and I’m now on the Hugo train.

Given the static nature of the generated content, there are obvious challenges when implementing engagement mechanisms. Share/social media links are pretty straight forward, but things like commenting require some sort of third party, external service. Fortunately there are many services out there providing this functionality. Disqus and commentbox.io are two such services.

Unfortunately, these services introduce unwanted tracking/beacon activity and they burden any potential commenter with the need to either login or signup. I get that providing signup free and anonymous(with the ability to supply an identifier if desired) posting isn’t for everyone, but this is exactly what I wanted. I couldn’t find any such option.

I did give commentbox.io a try because they claim painless embedding and no tracking. They are correct in that the embedding is painless, but I did notice some google analytics stuff going on and I wouldn’t exactly call that “No Tracking”.

Reviewing the embedding instructions, it’s literally add a div with a given class, add a script tag referencing a remote src, and another script tag to initialize the remote script. I thought “I could probably build something like this”.

Thus, RantBrain was born. The results can be seen at the bottom of this post. While very similiar in nature, my implementation differs in a few ways. As mentioned above, there is no login or signup process required for a commenter. I took this a step further and extended the same courtesy to the maintainer of the site using RantBrain(maybe this is just true laziness). commentbox.io’s implementation requires you to have a commentbox.io account, create a project for that account, and pass the project-id into the intialization function. My approach simply relies on window.location.href. When someone posts a comment, the comment is assigned a uri from window.location.href. When the page and script are loaded, window.location.href is used as a query string param to fetch posts for that location.

You can get started with RantBrain by adding this to your site:

 <div class="commentbox"></div>
  <script src="https://rantbrain.com/js/comment-min.js"></script>

  <script>
    // Block comments by Comment ID
    var block = [10, 8];

    // Initialize comment system
    initComments();
  </script>

At this time, the service is free of charge. Visit RantBrain for more info, or if you’d like to donate to help with operation costs.

And please leave a comment below!