Microsheep

MicroSheep's page

Rummaging IT fields since the 8-bits personal computers era.

4-Minute Read

Using a static site has many advantages but a major drawback: lack of interactivity with readers. Therefore, as described in a previous article, I tried to deploy and install Staticman. The problem is after many different approaches, including those listed as conclusion ot the article, it never worked.

I turned to several alternatives based on the suggestions from the HUGO web site, starting by Commento

First candidate: Commento

Commento is available as a service but it can also be self hosted. You can easily find documentation on how to integrate the commenting system to your site and there are even ready-to-use binaries released. Installation was straightforward but quickly it appeared that builds were not updated while bug were identified and left open. In short, Commento seems discontinued.

Variant of the first Candidate: Commentario

The situation of Commento is so stuck that it was forked as Commentario. Development on the project is active, according to the dates of last changes, and sports ambitious goals. However, the prerequisites to build Commentario were too hard to meet for me: not less than a recent version of GO and also Node.js to build a commenting system for a supposed simple static web site?

It was time to move to the next candidate.

Second candidate: Cactus

According to the amount of blog articles, Cactus seems to be very popular among HUGO users. Integration with HUGO is also well documented, making this solution very promising.

The picture is not so rosy when you follow Self Hosting Installation procedure and the first sentence is

You need to run your own Matrix homeserver.

What? Running the software foundation of Mastodon, alongside a Cactus server, of course, just to get comments on a static site? Whatever the quality of the result, there should be a lighter way to implement commenting and for example the next candidate.

Third candidate: Isso

I did not try Isso from the first time for two reasons. The first one is the tool appears underrated, being often presented as a basic commenting system, therefore not appearing as the universal solution. The second reason is that Isso is written in python and many peoples seem to have trouble running it as a server. Of course, python module dependency management enters the game and python virtual environments are almost unavoidable. In fact, Isso installation is not different of general python software. In addition, features provided by Isso are simply the ones needed for safe commenting: it does the job.

Integration of Isso into HUGO boils down to integrating a few lines of code into a HUGO layout to pass parameters and call javascript part of Isso:

<article class=post>
<script
  data-isso=https://my-isso-url 
  data-isso-require-author=true 
  data-isso-require-email=true 
  data-isso-reply-notifications=false
  src=https://my-isso-url/js/embed.min.js>
</script>
<noscript>Please enable JavaScript to view the comments powered by<a href=https://posativ.org/isso/>Isso</a>.</noscript>
<div><section id=isso-thread></section></div>
</article>

The following sites helped me setup my Isso instance:

Integration with HUGO layout.

I chose “Future Imperfect Slim” as site layout for its style but also for its out-of-the-box integration with Staticman. What about Isso? Luckily for me, Timo Geusch already integrated Isso into this specific HUGO layout for his blog. He extensively documented the process: thank you. Timo also released the modification of the layout to integrate Isso.

Please note that Future Imperfect Slim is not updated while HUGO is an active project with evolutions in syntax. It causes warning related to .Author keyword in the layout. A quick workaround is to replace by .Site.Author in the last lines of layouts/partials/head.html in the files of the Future Imperfect Slim layout.

  {{- if .Params.Author -}}
    {{- .Scratch.Set "Author" .Params.Author -}}
  {{- else -}}
    {{- .Scratch.Set "Author" .Site.Author -}}
  {{ end }}
</head>

Please also note that a few tweaks in the layout are required to correct the following errors in the javascript console of your browser:

add-on.css:1     Failed to load resource: the server responded with a status of 404 (Not Found)
add-on.js:1     Failed to load resource: the server responded with a status of 404 (Not Found)

For add-on.css, copy the file from exampleSite/static/css to static/css in the theme directory. This workaround comes from a bug report. Proceed similarly for add-on.js: copy exampleSite/static/js/add-on.js to the static/js theme directory (to be created if needed).

Results, so far and hopefully, for long

As of Summer of 2023, commenting is set with anti-spams settings and gravatar activated: let’s see in the following months how it happens.

Recent Posts

Categories

About

What can we find here?