# Free and open-source comments for Hugo

**URL:** <https://discourse.gohugo.io/t/free-and-open-source-comments-for-hugo/32940>\
**Category:** tips & tricks\
**Created:** [May 17, 2021, 7:53pm UTC](https://discourse.gohugo.io/t/free-and-open-source-comments-for-hugo/32940 "2021-05-17T19:53:55Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![iaeiou](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/iaeiou/32/15332_2.png) [@iaeiou](https://discourse.gohugo.io/u/iaeiou)\
**Post date:** [May 17, 2021, 7:53pm UTC](https://discourse.gohugo.io/t/free-and-open-source-comments-for-hugo/32940/1 "2021-05-17T19:53:55Z")

</div>

Hello there,

today I discovered a new candidate for comments on Hugo: [Cusdis](https://cusdis.com/)

I was searching for an easy and open-source solution, I’m convinced.

Here is an overview :

## Key features:

- open source
- lightweight (5kb)
- hosting is available for free - Cusdus can also be self-hosted
- easy to set up: no Heroku, no Github, no database required 🕶
- adding a comment does not require an account
- available in [several languages](https://cusdis.com/doc#/advanced/i18n)
- moderation, dashboard
- email notifications
- nested comments
- installed in 15 minutes

## Installation

Create an account on [Cusdis.com](http://Cusdis.com)

Get your token and use it in the field `data-app-id` below

Add this code to your footer. For me, it was in `layouts/_default/single.html`

```auto
      <!-- Comments by Cusdis -->
      <h4>Comments:</h4>
      <div id="cusdis_thread" data-host="https://cusdis.com"
        data-app-id="See your dashbord on Cusdis"
        data-page-id="{{ .File.UniqueID }}" data-page-url="{{ .Permalink }}"
        data-page-title="{{ .Title }}"></div>
      <script async defer src="https://cusdis.com/js/cusdis.es.js"></script>

```

(Reminder: you need to edit `data-app-id`)

**Done!**

## Demo

A demo is available [at the bottom of the documentation](https://cusdis.com/doc#/?id=compared-to-disqus) for example

You can see it running with Hugo on [roneo.org](https://roneo.org/en/hugo-custom-warning-infoboxes/#further-readings)

## Limitations:

- no notification to an original poster when an answer is published. Bug report [#78](https://github.com/djyde/cusdis/issues/109)
- no way to display the comment count next to the summary of an article. On the roadmap, see [#109](https://github.com/djyde/cusdis/issues/109)
- no way to add a reaction (emoji) to a comment. See [#58](https://github.com/djyde/cusdis/issues/58)

## Comparison with other tools

- **Disqus** is a privacy nightmare
- **Staticman** requires a complex setup of Heroku or another service
- **Uterrances** requires an account on Github to post a comment

**To help you remember the name** : the name _cus·dis_ comes from _dis·qus_. You got it?

---

<div class="post-metadata">

**Author:** ![alcarazr](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/alcarazr/32/11576_2.png) [@alcarazr](https://discourse.gohugo.io/u/alcarazr)\
**Post date:** [May 20, 2021, 8:59pm UTC](https://discourse.gohugo.io/t/free-and-open-source-comments-for-hugo/32940/2 "2021-05-20T20:59:27Z")

</div>

Thanks a lot for recommending this. I have implemented it in my website (blog post example [here](https://physichemically.com/blog/2020/04/28/hello-world/)), [including translations like this](https://github.com/rodrigoalcarazdelaosa/fisiquimicamente/blob/main/layouts/partials/comments/cusdis.html). Very happy with it so far!

---

<div class="post-metadata">

**Author:** ![vxson](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/vxson/32/14412_2.png) [@vxson](https://discourse.gohugo.io/u/vxson)\
**Post date:** [May 21, 2021, 10:12am UTC](https://discourse.gohugo.io/t/free-and-open-source-comments-for-hugo/32940/3 "2021-05-21T10:12:09Z")

</div>

highly recommended

---

<div class="post-metadata">

**Author:** ![alcarazr](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/alcarazr/32/11576_2.png) [@alcarazr](https://discourse.gohugo.io/u/alcarazr)\
**Post date:** [May 21, 2021, 3:02pm UTC](https://discourse.gohugo.io/t/free-and-open-source-comments-for-hugo/32940/4 "2021-05-21T15:02:45Z")

</div>

@iaeiou I’m using a [Multihost setup](https://gohugo.io/content-management/multilingual/#configure-multilingual-multihost) in my site and I’ve noticed that, for a given blog post for example, all translated pages, even though they have a different `.Permalink` (thus different `data-page-url`), they share the same `.File.UniqueID`, so that the `data-page-id` is the same and comments made on one of the pages show up in all translated pages. Do you have an idea how can I solve it?

Here you can see a page where this has happened:

- English version: [Hello World | PhysiChemically](https://physichemically.com/blog/2020/04/28/hello-world/) (source [here](https://github.com/rodrigoalcarazdelaosa/fisiquimicamente/tree/main/content/en/post/hola-mundo))

- Spanish version: [Hola Mundo | FisiQuímicamente](https://fisiquimicamente.com/blog/2020/04/28/hola-mundo/) (source [here](https://github.com/rodrigoalcarazdelaosa/fisiquimicamente/blob/main/content/es/post/hola-mundo/index.md))

In those pages, the comment in English was made from the English version, and the Spanish one from the Spanish page, but all comments show in all pages because as I say the `.File.UniqueID` is the same regardless of the language.

I’d appreciate any help. Thanks in advance!

Rodri

---

<div class="post-metadata">

**Author:** ![iaeiou](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/iaeiou/32/15332_2.png) [@iaeiou](https://discourse.gohugo.io/u/iaeiou)\
**Post date:** [May 21, 2021, 4:01pm UTC](https://discourse.gohugo.io/t/free-and-open-source-comments-for-hugo/32940/5 "2021-05-21T16:01:44Z")

</div>

Hi @alcarazr,

I found this reference in the forum [Create a custom id for each post - #6 by Jura](https://discourse.gohugo.io/t/create-a-custom-id-for-each-post/270/6) - I apparently already struggled with a similar issue (can’t remember in which context exactly) and used `.File.UniqueID`… My researches ended there at this time

A solution may be to concatenate this `.File.UniqueID` with another variable to minimize the risk of collision.

If anyone wants to have a look, the template of @alcarazr is here [fisiquimicamente/cusdis.html at 524f439a6db0d6770863389c5b849f4916a8a8f2 · rodrigoalcarazdelaosa/fisiquimicamente · GitHub](https://github.com/rodrigoalcarazdelaosa/fisiquimicamente/blob/524f439a6db0d6770863389c5b849f4916a8a8f2/layouts/partials/comments/cusdis.html)

---

<div class="post-metadata">

**Author:** ![iaeiou](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/iaeiou/32/15332_2.png) [@iaeiou](https://discourse.gohugo.io/u/iaeiou)\
**Post date:** [May 21, 2021, 4:06pm UTC](https://discourse.gohugo.io/t/free-and-open-source-comments-for-hugo/32940/6 "2021-05-21T16:06:50Z")

</div>

> [@iaeiou](#):
>
> A solution may be to concatenate this `.File.UniqueID` with another variable to minimize the risk of collision.

Keeping in mind that some variables may vary on purpose, like the file name or post Title. The comments must land in the same queue despite such modifications

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [May 21, 2021, 5:07pm UTC](https://discourse.gohugo.io/t/free-and-open-source-comments-for-hugo/32940/7 "2021-05-21T17:07:46Z")

</div>

At some point we needed an immutable unique ID for each markdown file, so we placed this in the archetype:

```auto
uid = "{{ md5 (printf `%d%s%s` now.UnixNano .File.Path (getenv `USERNAME`)) }}"

```

Which produces something like:

```nohighlight
+++
uid = "48ac3ee34ac60f3879b2f303843dd7ab"
+++

```

Yes, this exposes the unique ID in front matter, but the ID remains the same regardless of future changes to file path, title, content, etc.

---

<div class="post-metadata">

**Author:** ![alcarazr](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/alcarazr/32/11576_2.png) [@alcarazr](https://discourse.gohugo.io/u/alcarazr)\
**Post date:** [May 21, 2021, 8:14pm UTC](https://discourse.gohugo.io/t/free-and-open-source-comments-for-hugo/32940/8 "2021-05-21T20:14:53Z")

</div>

I’m not sure how this can help me with my problem. Is there a way I can associate a really unique ID to each of my pages? The problem arises with translations, where each page shares the same path and file name, just changing the folder containing it.

Thanks!

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [May 21, 2021, 10:38pm UTC](https://discourse.gohugo.io/t/free-and-open-source-comments-for-hugo/32940/9 "2021-05-21T22:38:51Z")

</div>

> [@alcarazr](#):
>
> I’m not sure how this can help me

It won’t, unless you create _every_ page in _every_ language with `hugo new`.

---

<div class="post-metadata">

**Author:** ![djyde](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/djyde/32/14423_2.png) [@djyde](https://discourse.gohugo.io/u/djyde)\
**Post date:** [May 22, 2021, 7:53am UTC](https://discourse.gohugo.io/t/free-and-open-source-comments-for-hugo/32940/10 "2021-05-22T07:53:30Z")

</div>

I think page slug is a good choice in this case.

---

<div class="post-metadata">

**Author:** ![alcarazr](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/alcarazr/32/11576_2.png) [@alcarazr](https://discourse.gohugo.io/u/alcarazr)\
**Post date:** [May 22, 2021, 10:48am UTC](https://discourse.gohugo.io/t/free-and-open-source-comments-for-hugo/32940/11 "2021-05-22T10:48:50Z")

</div>

For now I’m going to solve it appending the language code like this:

```auto
data-page-id="{{ print .File.UniqueID .Site.Language.Lang }}"

```

---

<div class="post-metadata">

**Author:** ![iaeiou](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/iaeiou/32/15332_2.png) [@iaeiou](https://discourse.gohugo.io/u/iaeiou)\
**Post date:** [May 25, 2021, 12:48am UTC](https://discourse.gohugo.io/t/free-and-open-source-comments-for-hugo/32940/12 "2021-05-25T00:48:58Z")

</div>

I updated the original post to point to the relevant issues on Github.

(thank you @alcarazr for asking for the feature “comment count”!)

---

<div class="post-metadata">

**Author:** ![iaeiou](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/iaeiou/32/15332_2.png) [@iaeiou](https://discourse.gohugo.io/u/iaeiou)\
**Post date:** [May 26, 2021, 6:47am UTC](https://discourse.gohugo.io/t/free-and-open-source-comments-for-hugo/32940/13 "2021-05-26T06:47:48Z")

</div>

It seems to be possible to show comment count now: [Cusdis Documentation](https://cusdis.com/doc#/advanced/show-comment-count)

---

<div class="post-metadata">

**Author:** ![alcarazr](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/alcarazr/32/11576_2.png) [@alcarazr](https://discourse.gohugo.io/u/alcarazr)\
**Post date:** [May 26, 2021, 9:21am UTC](https://discourse.gohugo.io/t/free-and-open-source-comments-for-hugo/32940/14 "2021-05-26T09:21:06Z")

</div>

Already implemented it in my website. Example [here](https://physichemically.com/blog/2020/07/08/science-pills/):

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/2X/7/7e119743c34dc50ba009f59782a8dec814345a61.png)

Relevant code [here](https://github.com/rodrigoalcarazdelaosa/fisiquimicamente/blob/4e6afd4e3de25eb2d8f3479ad275c704631be352/layouts/partials/page_metadata.html#L48-L57):

```auto
💬&nbsp;<span data-cusdis-count-page-id="{{ print $page.File.UniqueID site.Language.Lang }}">0</span>
<script defer data-host="https://cusdis.com" data-app-id="b9b5c1f3-2af7-4ef5-9d26-4c2b44a1d829" src="https://cusdis.com/js/cusdis-count.umd.js"></script>

```

---

<div class="post-metadata">

**Author:** ![iaeiou](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/iaeiou/32/15332_2.png) [@iaeiou](https://discourse.gohugo.io/u/iaeiou)\
**Post date:** [May 26, 2021, 6:07pm UTC](https://discourse.gohugo.io/t/free-and-open-source-comments-for-hugo/32940/15 "2021-05-26T18:07:54Z")

</div>

That was fast!  
Is it the same piece of code on the post list and in the single article view?

---

<div class="post-metadata">

**Author:** ![alcarazr](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/alcarazr/32/11576_2.png) [@alcarazr](https://discourse.gohugo.io/u/alcarazr)\
**Post date:** [May 26, 2021, 9:09pm UTC](https://discourse.gohugo.io/t/free-and-open-source-comments-for-hugo/32940/16 "2021-05-26T21:09:44Z")

</div>

Yeah, both share the same [`page_metadata.html` partial](https://github.com/rodrigoalcarazdelaosa/fisiquimicamente/blob/main/layouts/partials/page_metadata.html).

---

<div class="post-metadata">

**Author:** ![jehoshua7](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jehoshua7/32/13763_2.png) [@jehoshua7](https://discourse.gohugo.io/u/jehoshua7)\
**Post date:** [July 12, 2022, 1:35am UTC](https://discourse.gohugo.io/t/free-and-open-source-comments-for-hugo/32940/17 "2022-07-12T01:35:13Z")

</div>

Has anyone used this ? - [GitHub - gitalk/gitalk: Gitalk is a modern comment component based on Github Issue and Preact.](https://github.com/gitalk/gitalk)

---

<div class="post-metadata">

**Author:** ![ervinjason](https://avatars.discourse-cdn.com/v4/letter/e/9e8a1a/32.png) [@ervinjason](https://discourse.gohugo.io/u/ervinjason)\
**Post date:** [July 15, 2022, 9:39pm UTC](https://discourse.gohugo.io/t/free-and-open-source-comments-for-hugo/32940/18 "2022-07-15T21:39:39Z")

</div>

I apparently already struggled with a similar issue (can’t remember in which context exactly) and used `.File.UniqueID`… My researches ended there at this time

A solution may be to concatenate this `.File.UniqueID` with anoth[e](https://alightmotionapk.co/mod/)r variable to minimize the risk of collision.

---

<div class="post-metadata">

**Author:** ![iaeiou](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/iaeiou/32/15332_2.png) [@iaeiou](https://discourse.gohugo.io/u/iaeiou)\
**Post date:** [January 24, 2024, 9:30am UTC](https://discourse.gohugo.io/t/free-and-open-source-comments-for-hugo/32940/19 "2024-01-24T09:30:56Z")

</div>

Instead of using a partial, Cusdis comment form can be inserted with this shortcode:

```auto
{{- /* Comments with cusdis.com */ -}}

{{ if .Site.Params.CommentsCusdisID }}

    <div id="cusdis_thread" data-host="https://cusdis.com"
      data-app-id="{{ .Site.Params.CommentsCusdisID }}"
      data-page-id="{{ .Page.File.UniqueID }}"
      data-page-url="{{ .Page.Permalink }}"
      data-page-title="{{ .Page.Title }}">
    </div>
    <script defer src="https://cusdis.com/js/widget/lang/fr.js"></script>
    <script async defer src="https://cusdis.com/js/cusdis.es.js"></script>
{{end}}

{{- /* Comments area end */ -}}

```

All credits [to jmooring](https://discourse.gohugo.io/t/how-to-get-file-uniqueid-from-a-shortcode/47938)

---

<div class="post-metadata">

**Author:** ![tyco](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/tyco/32/23754_2.png) [@tyco](https://discourse.gohugo.io/u/tyco)\
**Post date:** [April 30, 2025, 8:41am UTC](https://discourse.gohugo.io/t/free-and-open-source-comments-for-hugo/32940/20 "2025-04-30T08:41:14Z")

</div>

I just saw this, but cannot confirm if it is open or closed source

> **[Teemboom Comments](https://teemboom.com/)**

[Next page](https://discourse.gohugo.io/t/free-and-open-source-comments-for-hugo/32940.md?page=2)
