Blog post comments and likes

I have a blog and I create posts and categories using the CMS. And now need to create an open comments section with likes and a share button and I’m thinking of how this can be implemented.

Is there an API that I can call outside de admin to create these comments and likes? How would be the setup to make this work? Any ideas are welcome!

1 Like

Hey @darksoulsong,

It’s been a while since I’ve dabbled but I’m sure Staticman was a bit of a go-to for this sort of functionality!

@Scott thanks for your reply. I read a little of the Staticman docs and it seems it doesn’t fit my needs, as I’m looking for something integrated with NetlifyCMS so I can centralize the comments moderation and post writing in a single place.

I wonder if @erez has stumbled across anything which might fit the bill? Hopefully he might have some ideas when he’s back next week :+1:.

Hi @darksoulsong and @Scott, the CMS writes files to your git repo, so if you want any visitor to the site to add comments/likes via the CMS they would need access to your repo which I don’t think is recommended.

You could use an external service for saving the comments (for example https://disqus.com/) and write a custom widget that would use the service API to display the comments and moderate them via the CMS if you want to keep everything in the same place.

3 Likes

You might want to check Isso https://posativ.org/isso/ for a self-hosted privacy-respecting alternative to disqus :wink:

@ImaCrea I don’t think you can use Isso with Netlify, since it requires SQLite backend.

I was thinking utterances, but this uses GitHub issues and the API rate is limited to:

60 per hour (Non-Authenticated users)
5000 per hour (Authenticated users)

@erez The reason why I wouldn’t suggest Disqus is:

  • They come with ads in their free plan
  • They collect user data (very unfriendly to your privacy)
  • They are breaking the GDPR law and sharing visitor data
  • Performance degradation (sends many 3rd-party requests)

I just rebuilt my personal blog in Eleventy and deployed it on Netlify, and I wrote about how I implemented commenting with notifications and moderation, using Netlify Functions and the GitHub API (among other things). Other people have come up with similar solutions too, the way I did it isn’t the only option.

I don’t use Netlify CMS with my site, but my commenting system should be compatible with it. And I’m not sure which SSG you’re using, but it should be possible to implement something similar with most of the other popular ones (e.g. Hugo, Next.js).

2 Likes

this is great, jaza! thanks for sharing!

1 Like