I’m looking forward to adding a comment section to Hugo’s post. I have seen several alternatives that support Hugo’s comments.
My question is:
What would be the ideal way to add comments without affecting loading time?
If you know any open source alternative, suggest the best approach and practices to add comments.
A code sample will be great, if available.
In my opinion, there is no objectively best solution. Every commenting system I know of has advantages and disadvantages, so you have to decide what suits you best.
I personally use the commenting system Isso (https://isso-comments.de). It is based on Python and a SQLite database, so I can easily host Isso myself.
At fryboyter.de/comments.html at main - fryboyter.de - Codeberg.org you can find the code I use to display the comments section below a post. But important is only line 15 and 16 (and the final tag div tag).
At fryboyter.de/metadata.html at main - fryboyter.de - Codeberg.org you can find the code (line 8) that I use to show how many comments there are so far under an article title.
But at Getting started you can actually find a pretty good description that was created by the developers of Isso. This is probably better than my code.
Here are some commenting systems that you can use with Hugo
I’m using Cusdis and I’m satisfied with it.
See Free and open-source comments for Hugo
Are you using the public instance or the self hosted version?
I agree that Cusdis is amazing, but I am concerned because they have no way to export comments.
I’m using the public instance, and I agree about the missing export option. Does the according feature request exist?
yes. it’s here
and it seems that they want to add the feature so that’s nice.
There system is really nice and I would use it if it had that feature. But because that feature is missing I am working on my own personal comments system (I made a thread about it).