Hugo static website

How to integrate Comentario comments with a website built in Hugo

Hugo is a popular, powerful static website generator written in Go (also used to build this documentation by the way).

  1. Look up the HTML snippet in you domain properties.
  2. Create a comment partial template in layouts/partials/comments.html:
<!-- Your HTML snippet goes here -->
<script defer src="https://example.com/comentario.js"></script>
<comentario-comments></comentario-comments>
  1. Reference this partial template in the appropriate template located under layouts. For example, layouts/_default/single.html:
{{ define "main" }}
<main>
    <!-- Main content -->
    {{ .Content }}

    <!-- Comentario comments -->
    {{- partial "comments" . }}
</main>
{{ end }}

Adjust the above code as you see fit.