Giscus is a solid option if you’re looking for a low-impedance alternative to Disqus.
Remember when Disqus was a thing?
I didn’t know better at the time so I just went with it.
So I know I’m probably late to the lets-move-away-from-disqus-party, but now, re-writing this blog and re-thinking the tech stack behind it, it was time to give some more thought to this.
So why all the hate?
Disqus is a “free” commenting engine.
“free” as in you’re probably the product now.
Unfortunately, your website visitors have become the product too.
Disqus is an advertising company
Disqus was acquired by Zeta Global in 2017 1.
So it’s definitely not about maximising revenue? Right?
People who’s tech opinion I trust
Bozhidar Batsov, an Emacs Hacker, and creator of cider said (a long while ago):
I got so fed up with @disqus's obnoxious ads and disregard for privacy that I finally migrated the comments of my main blog (https://t.co/2gUgV3yVEM) to @HyvorTalk, a comment system that actual values your privacy. I highly recommend you to do the same!— Bozhidar Batsov (Bug) 🇧🇬🇪🇺🇺🇦 (@bbatsov) December 7, 2020
- High load times (upward of 2MB of data)
- Tracking and targeted ads
- Injected pixel tracking
At this point, the flaws outweigh the benefits.
It’s time for an alternative.
What I was looking for
When looking for an alternative, this is what I had in mind.
- This blog is hosted on Netlify so I didn’t want to self-host anything (no mucking around with VMs or databases of any kind)
- No tracking whatsoever
- A somewhat good user experience (don’t want users signing up for a separate service)
Giscus looked promising.
It’s free and open source.
It doesn’t track you or your users.
You can self-host if you want, but you don’t have to. I believe it is hosted on Vercel currently.
The most attractive aspect for me is that it uses GitHub Discussions to host the comments.
GitHub is a platform I’m certainly familiar with and feel comfortable enough to allow for the vendor lock-in. If users would like to leave a comment (or a post reaction) they would need to have a GitHub account, which I think majority of the users reading my blog would have.
It is also incredibly simple to setup.
Just follow the instructions on Giscus starter page.
- Enable the GitHub Discussion feature on an existing or new public GitHub repo.
- Install the Giscus app and allow access to the repo
- Copy the
scriptto your websites template. If you using Hugo it will most probably be
/layouts/partials/comments.htmlor something similar.
Figures 1 and 2 shows what it looks like.
Limiting access from certain origins
It might be wise to restrict access to certain domains.
Giscus allows for creating a
giscus.json configuration in the repo hosting the comments. See here for
Dynamic theme toggling for light/dark mode
Giscus exposes an interface allowing you to send a message to the Giscus iFrame which changes the theme without needing a full page refresh.
This blog has a button (top left, next to the header, with an ID of
theme-toggle) which toggles the theme.
In my case, the
comments.html template is as follows.
Locking discussions prevents further comments
If you lock the discussion from GitHub Discussions, this prevents further comments as well.
What about migrating old comments from Disqus?
I think my old blog had like 3 users at its peak (no citation here folks, sorry) so I felt comfortable letting these go.
Utterances is almost identical to Giscus with just one notable difference.
Utterances is built on top of GitHub issues, where is Giscus is built on top of GitHub’s newer Discussions feature.
I’ll admit I’m a bit of a Magpie in this regard.
Isso looked really promising, but again, I didn’t want to self-host anything.
I’m sure it would have been possible with a Netlify’s reverse proxy features but I didn’t want to go down that dark road.
Giscus provides a low-impedance approach to hosting comments on your site or blog.
If you’re comfortable with the lock-in with using GitHub Discussions it’s a great choice.