If you’re interested in adding a comment section to your own website, take a look at the cactus chat website.

I followed their quick start guide to write myself a hugo shortcode which looks like this:

<link rel="stylesheet" href="https://latest.cactus.chat/style.css" type="text/css">
<script type="text/javascript" src="https://latest.cactus.chat/cactus.js"></script>
<br>
<hr> </hr>
<h3>Comments <i class="fa fa-comments fa-2x" aria-hidden="true"></i> </h3> 
<div id="comment-section"></div>
<script>
initComments({
  node: document.getElementById("comment-section"),
  defaultHomeserverUrl: "https://matrix.cactus.chat:8448",
  serverName: "cactus.chat",
  siteName: "MaxBlog",
  commentSectionId: "{{ index .Params 0}}"
})
</script> 

It is named chat.html and can be called like this:

{{< chat example-chat >}}

Feel free to leave a comment :)



Comments