Adding Privacy-Friendly Comments to a Hugo Site with Chirpy

Topics: Hugo , Web Development , Disqus
Table of Contents

I needed a comment system for this blog. Not because I expect a flood of discussion (let’s be honest, most personal tech blogs don’t) but because those rare moments when someone has a question or insight are worth enabling. The challenge? Finding a solution that respects privacy, stays free or cheap, and doesn’t require a PhD in server administration.

The Search: What I Actually Needed

My requirements were straightforward:

  1. Privacy-preserving - No aggressive tracking or data selling
  2. No account required - Reduce friction for commenters
  3. Anonymous commenting - Allow users to comment without revealing their identity
  4. Free or cheap - This is a personal blog, not a business
  5. Proper moderation - I need to delete spam and get notified of new comments
  6. Simple setup - Ideally just drop in a script tag
  7. Future flexibility - Open source preferred, so I could self-host later if needed

Why Not Disqus?

I tried Disqus first. It’s the obvious choice. It’s nearly ubiquitous, feature-rich, and easy to set up. But the more I learned about its privacy practices, the less comfortable I felt.

Disqus uses third-party JavaScript widgets that function as tracking beacons across the web. Even when users aren’t logged in, it collects IP addresses, browser fingerprints, installed add-ons, and browsing patterns. This data gets shared with third-party advertisers. During 2024 alone, Disqus received 468 data access requests, and user data is processed by teams across the United States, India, and the Philippines.

For a blog focused on technical integrity, using a comment system that monetizes visitor data felt really slimy. I needed something better.

The Alternatives

I explored several options:

  • Talkyard - I like this a lot. It reminds me of Discourse however there is no free tier and this site is not making any money and doesn’t have enough traffic to justify the cost.
  • Giscus - GitHub-based comments using Discussions. Great for developer blogs, but requires readers to have GitHub accounts
  • Chirpy - Privacy-focused, open source, simple to set up

Chirpy checked all the boxes. It’s privacy-preserving by design, has a clean moderation interface, offers cloud hosting on a free tier (with paid pro options), and being open source means I could self-host in the future if my needs change. And I love that it doesn’t require users to create an account.

The Implementation

The beauty of Chirpy is how straightforward the integration is. For a Hugo site like this one, you only need two things:

Chirpy’s docs have a very simple Get started guide.

1. Load the Chirpy Script

First we simply add this script to your page’s HTML in the <head> section:

<script
  defer
  src="https://chirpy.dev/bootstrapper.js"
  data-chirpy-domain="<your-domain>"
></script>

Then add the data-chirpy-comment attribute to any HTML element that should render the comment widget:

<div data-chirpy-comment="true" id="chirpy-comment"></div>

So I modified my hugo template by editing layouts/partials/head.html:

{{- if .Site.Params.chirpy.enabled }}
{{- $chirpyDomain := "example.com" }}
{{- if hugo.IsProduction | or (eq site.Params.env "production") }}
    {{- $chirpyDomain = .Site.Params.chirpy.domain }}
{{- end }}
<script
    defer
    src="https://chirpy.dev/bootstrapper.js"
    data-chirpy-domain="{{ $chirpyDomain }}"
></script>
{{- end -}}

This loads Chirpy only when enabled in config, so I can easily turn it off in my config for different environments.

I also use example.com in development so I don’t pollute my production comment threads during local testing.

2. Add the Comment Widget

Create a layouts/partials/comments.html partial that includes the Chirpy widget where you want comments to appear:

{{- $allowedSections := slice "thoughts" "posts" "essays" -}}
{{- $currentSection := .Section -}}

{{- if in $allowedSections $currentSection -}}
    {{- if and .Site.Params.chirpy.enabled .Site.Params.chirpy.domain -}}
    <hr style="margin-top: 40px; margin-bottom: 40px;" />
    <div data-chirpy-comment="true" id="chirpy-comment"></div>
    {{- end -}}
{{- end -}}

I only show comments on posts, essays, and thoughts—not on project pages or the homepage. The data-chirpy-comment="true" attribute tells Chirpy where to render the comment interface.

3. Include Comments in Templates

Add the comments partial to your single page templates. In layouts/posts/single.html:

{{ define "main" }}
<div class="wrapper post">
    <main class="page-content" aria-label="Content">
        <article>
            <!-- Article content -->
            {{ .Content }}
        </article>
        {{- partial "comments.html" . -}}
    </main>
</div>
{{ end }}

And I repeated this for layouts/essays/single.html and layouts/thoughts/single.html.

4. Configure in config.toml

Enable Chirpy and specify your domain:

[params.chirpy]
  enabled = true
  domain = "dandylyons.net"

That’s it. Four small changes, maybe 30 minutes of work including testing.

Testing

I tested locally with hugo server -D --buildFuture to verify the widget loaded correctly (with the development domain). Then I deployed to Netlify and tested on the live site to confirm comments worked in production.

No issues. No debugging. It just worked.

What I Appreciate

Simplicity - The entire setup is a script tag and a div. No OAuth flows, no complex configuration, no database setup.

Privacy - Chirpy doesn’t track users across sites or sell data to advertisers. Comments are stored on Chirpy’s servers (or your own if self-hosted), not scattered across a marketing data ecosystem.

Moderation - The Chirpy dashboard lets me approve, delete, and respond to comments. I get notifications when new comments arrive.

Open source - If I outgrow the free tier or want complete control, I can self-host Chirpy using the same interface.

Cost - Free tier works perfectly for personal blogs. Pro plans exist if you need more.

The Result

Comments now appear at the bottom of posts, essays, and thoughts on this site. Visitors can leave comments without creating an account (though they can use GitHub or email for notifications). I can moderate from a simple dashboard. No one gets tracked across the web.

For a static Hugo site that values privacy and simplicity, Chirpy hit the sweet spot. If you’re building a personal blog and want to enable conversation without compromising on privacy, give it a look.


Resources:


Sources:


This was written by Daniel Lyons.

If you'd like to support him, please consider buying him a coffee so he can create more content like this.