Motivation:

As an initial approach, I was using the Disqus commenting platform on this site. Disqus is nicely integrated in Hugo and so getting this service up and running a static site is no big deal.

(Hugo is a static site generator which allows you to create web sites completely independently of any web service and off-line on your local computer).

Although after a while of usage (and very little comment activity), I felt I need to replace Disqus for various reasons. Ideally a commenting system should be open source, easy to install, self-hosted and I also would like to use sqlite as database backend.

After searching for quite a while in the web for such a candidate, I stumbled upon HashOver. (Hashover did not even claim to have support for sqlite but in the lates release 2.0 there is!)

Hashover is …

  • .. a free and open source PHP comment system, find more information here: http://tildehash.com/?page=hashover
  • … a self-hosted system and allows completely anonymous comments to be posted, the only required information is the comment itself.

HashOver - installation in brief:

The following is more or less a cheat sheet for me to remember the steps required to get HashOver installed.

To install an add-on software, I usually create a sub-domain with a dedicated directory. This allows me to organize the directory structure on the server as I want to. No need to create any re-directions on the web server, no need to mess around with apache’s .htaccess file.

T install HashOver on a sub-domain the following step are required so far:

  • create a sub-domain on the provider’s portal e.g. like

        sub domain-name: cmd.my-domain-name.eu
        directory:       /my-domain-name.eu/cmd
    
  • download the HashOver software from github and copy it with ftp (filezilla) onto the webserver

    the web server directory might look like:

        /my-domain-name.eu/cmd/hashover
    

    Note: There is a version 2 available already, so I opted for this new release.

  • once done, the following files need to be edited and configured as described in the docmentation

    • /my-domain-name.eu/cmd/hashover/backend/classes/secrets.php
    • /my-domain-name.eu/cmd/hashover/backend/classes/sensitivesettings.php

    Please note that in the sensitivesettings.php the hostname of the sub-domain needs to be entered otherwise HashOver will throw an error saying: hashover external use not allowed

  • once done, HashOver’s admin panel should be already fully functional, go to the url to test:

    cmd.my-domain-name.eu/hashover/admin

  • but wait - latest PHP version needs to be enabled on the provider’s site which for the moment is PHP 7.X.X stable.

Hugo site configurations:

To enable commands on each individual blog page is pretty straightforward:

  • head.html:

    Found out that since the latest version 2 this is not required/valid anymore:

    <!-- hashover -->
    <link href="http://cmd.my-domain-name.eu/hashover/comments.css"
          rel="stylesheet" type="text/css">
    
  • single.html

    To initialize the comments system, place the following code whereever it’s suitable.

        <!-- page comments -->
        {{ if not (in (.Site.BaseURL | string) "localhost") }}
    
            <div id="hashover"></div>
    
            <!-- load asynchronous -->
            <script type="text/javascript">
                (function() {
                    var s = document.createElement('script'),
                    t = document.getElementsByTagName('script')[0];
                    s.type = 'text/javascript'; s.async = true;
                    s.src = src="http://cmd.my-domain-name.eu/hashover/comments.php";
                    t.parentNode.insertBefore(s, t); })();
            </script>
                
        {{ else }}
            <h2 style="color:Orange;"> Comments will appear here! </h2>
        {{ end }}
    
    

At this stage the comments should be fully operational. O.k. not locally, while developing and editing the static site, but on the web-server after transfering the site onto the privider’s web-space.

Known Problems:

  • If cookies are disabled, is is not possible any more to login as admin. So, for the moment, cookies muts be set to enabled.

    Settings are managed by the following JSON file: /hashover/config/settings.json

  • Comments are not shown on outdated browsers and javascript must be enabled.