Add comments to a Hugo site

Add a comment section with AI moderation to a Hugo blog. One script and one tag in your post template, no build step.

Crowment is a web component, so a Hugo site only needs the embed code in the template that renders a post.

Create a widget

Sign in to Crowment, create a comment widget for your site's domain and copy its app key from Install & Embed.

Copy your post template

Find the template that renders a single post in your theme, usually single.html or page.html under themes/<theme>/layouts/. Copy it to the same path under your site's own layouts/ folder. Hugo uses your copy instead of the theme's, and theme updates won't overwrite your change.

Add the embed code after the content

{{ .Content }}

<script defer src="https://embeds.crowment.com/comments.js"></script>
<crow-comments app-key="YOUR_APP_KEY"></crow-comments>

Build and check

Run hugo server and open a post. Each post gets its own thread, identified by its URL path.

If your theme already calls a comments partial (look for partial "comments.html" in the template), you can put the embed code in that partial instead and leave the template alone.

Next steps

Ready to add comments to your website?

Get started in minutes with Crowment's simple comment widget. No coding required — just copy, paste, and engage with your visitors.