Adding Comments to Static Blogs

When I first started using Jekyll, the static blog engine behind [email protected], I was concerned about two things: SEO and comments. Unlike Wordpress, Jekyll isn’t bundled with much more than the basics.

The SEO issue is surmountable with site maps, good URL building, and daily prayers to Google, but comments are another story. You have to use a third-party service like Disqus or Livefyre, both of which come with limitations and vendor lock in.

That’s why I decided to use GitHub as my comment engine. I already use it everyday, most of the folks interested in commenting use it too, and there’s a great API backing it all up.

I have a public repo specifically for comments and I create a new issue for every post. This enables a rich commenting experience with support for markdown, post-submission editing, and email notifications.

It’s a pretty slick solution, but until recently, I didn’t have a way to display comments onsite, readers had to go to GitHub. Fortunately, I found Petal from 王超. It’s a jQuery plugin that uses a proxy to pull the content from and post to issues without leaving the page.

A Git@Me comment thread


You can restyle & modify Petal easily using SASS and the included makefile. I suggest replacing the default Control+Enter keyboard shortcut with a post button.



Join the discussion

2017 Neal Shyam