--- --- Comments Back On
Article Image
Article Image
read

I’m experimenting with turning back comments on selected articles. It applies to handpicked posts and you can comment using Github Issues.

Artsy

Huge thanks to Artsy for the idea. Make sure to take a look at their guide on how to use Github Issues as a platform to host comments. You can also take a look at the pull request for the change.

A guide

The general concept is that you have some JavaScript in your page which requests a list of comments from GitHub. These are available as a JSON API, you can grab that then style the results. Sounds easy right?

  1. Get gh-commentify
  2. Go to the Github profile of an account that has repo access and generate an API Key. Put that and the Github account name in Heroku when asked. Deploy and take a note of the URL.
  3. Create the HTML of the comment as you want it. You can take a look here for ideas. Put the file in _includes/gh_comments.html. If you build your own HTML, make sure to include the javascript from the link.
  4. In your article template include the comment:
  1. If you want to style your comment add a .css or .scss file on .comment
  2. Open an Issue on the repo and copy the Issue id.
  3. Add comment_id in your YAML for the post with the Issue id. If it’s not present comments will be off.

Accountability

The problem I had with comments was lack of accountability and spam. This system resolves both of them.

It supports markdown and as a developer, you can use the same flow you use normally on Github.

Blog Logo

Valentino Urbano


Published

Image

Valentino Urbano

iOS Developer, Swift, Writer, Husband

Back to Overview