Featured image of post Adding a Remark42 comment system to my statically-generated blog

Adding a Remark42 comment system to my statically-generated blog

Since I moved my blog from Wordpress to Hugo a year ago, I never took the time to set up a comment system. It was about time to fix this.

The CaiJimmy’s Stack theme supports nearly a dozen comment systems out of the box. Some of them are commercial (like Disqus), while others rely on Github issues (Gitalk, Giscus…) which I wanted to avoid.

I quickly decided to use Remark42, a privacy-focused lightweight commenting engine. As stated on its website, Remark42 allows you to have a self-hosted, lightweight, and simple (yet functional) comment engine, which doesn’t spy on users. Perfect, isn’t it?

It turned out to be super simple to set up as I already had a Docker environment ready-to-use with an Nginx/LetsEncrypt proxy.

# Create named volume to store data permanently

docker volume create remark42_data

# Run remark42 docker container

docker run -d \
  --name="remark42" \
  --hostname="remark42" \
  --restart="always" \
  --network="nginxproxy" \
  -e "VIRTUAL_HOST=remark42.hleroy.com" \
  -e "VIRTUAL_PORT=8000" \
  -e "LETSENCRYPT_HOST=remark42.hleroy.com" \
  -e "LETSENCRYPT_EMAIL=hleroy@hleroy.com" \
  -e "REMARK_URL=https://remark42.hleroy.com" \
  -e "SITE=hleroy" \
  -e "SECRET=redacted" \
  -e "AUTH_GITHUB_CID=redacted" \
  -e "AUTH_GITHUB_CSEC=redacted" \
  -e "ADMIN_SHARED_ID=redacted" \
  -e "AUTH_ANON=true" \
  -v "remark42_data:/srv/var" \
  umputun/remark42:latest

And finally, update Hugo’s configuration (params.toml):

## Comments
[comments]
enabled = true
provider = "remark42"

[comments.remark42]
host = "https://remark42.hleroy.com"
site = "hleroy"
locale = "fr"

Now, you can scroll down to the bottom of this page and leave a comment 😄

Licensed under CC BY-NC-SA 4.0
Dernière mise à jour le Nov 02, 2023 16:40 +0100
Généré avec Hugo
Thème Stack conçu par Jimmy