Using GitHub for comments on your blog
As I’ve just started to build my personal website, I wanted to add a comment section for each published article. Previously I’ve used Disqus to do so - however, this time I wanted to keep it as lightweight as possible.
Disqus is a great product, no question there. But all the great features Disqus has to offer come with a price. A price you will pay with the loading time of your website:
const apiUrl = 'https://api.github.com/repos/gergelyke/gergelyke.github.io/issues/<%- page.githubIssueId %>/comments'
Actually, you can already comment on this post using the very technique you just read about! Give it a try! 😎
You can see the actual implementation here.
As most solutions, using GitHub for the comment engine on your site has some drawbacks:
- GitHub rate limits its’ APIs, so this solution won’t work if you have a huge number of visitors,
- it only suits audiences with GitHub accounts.
If you are ok with this limitations, GitHub provides a great way to let your audience comment on your writings.