<commit_before>---
layout:     post
title:      Using GitHub to blog host comments&#58; a working example
date:       2017-01-19 19:00:00
summary:    Some smart people figured out how to use the GitHub issue tracker for hosting blog comments, but their example is outdated and missing some steps. Here's how I got it working.
categories: codemonkey jekyll javascript
commentIssueId: 23
---

Up until recently, I was using Disqus as my blog comment system. I never
really liked it much though; it was convenient, but I prefer to have all
of my blog in one place (i.e. on 
[GitHub](https://github.com/mkoohafkan/mkoohafkan.github.io)).
I recently came across 
[this blog](http://ivanzuzak.info/2011/02/18/github-hosted-comments-for-github-hosted-blogs.html), 
which provides instructions on how to query GitHub issues and load them
into a page. It might not be the right solution for everyone---you need
to hve a GitHub account to comment on issues---but it seemed perfect for
me. I excitedly copied the code into my repository, disabled 
Disqus, and committed the changes (since I haven't set up Ruby or a 
Jekyll environment on computer, all of my testing happens live). 

Of course, things rarely work out of the box. A quick recheck of the 
blog post revealed it was written back in 2011, and things have, um, 
changed a bit in the last six years. The basic procedure still works, 
but I'll re-explain the process with my updates.

The first two steps are the same: you need to manually create an issue 
in your blog repository's issue tracker for each blog post you publish,
and you need to add the issue number to your post's YAML front matter.
To give you some examples, 
[here](https://github.com/mkoohafkan/mkoohafkan.github.io/issues/23)
is the issue I created for this post, and 
[here](https://github.com/mkoohafkan/mkoohafkan.github.io/blob/master/_posts/2017-01-19-using-github-to-host-blog-comments.md) <commit_msg>ugh another typo<commit_after>---
layout:     post
title:      Using GitHub to host blog comments&#58; a working example
date:       2017-01-19 19:00:00
summary:    Some smart people figured out how to use the GitHub issue tracker for hosting blog comments, but their example is outdated and missing some steps. Here's how I got it working.
categories: codemonkey jekyll javascript
commentIssueId: 23
---

Up until recently, I was using Disqus as my blog comment system. I never
really liked it much though; it was convenient, but I prefer to have all
of my blog in one place (i.e. on 
[GitHub](https://github.com/mkoohafkan/mkoohafkan.github.io)).
I recently came across 
[this blog](http://ivanzuzak.info/2011/02/18/github-hosted-comments-for-github-hosted-blogs.html), 
which provides instructions on how to query GitHub issues and load them
into a page. It might not be the right solution for everyone---you need
to hve a GitHub account to comment on issues---but it seemed perfect for
me. I excitedly copied the code into my repository, disabled 
Disqus, and committed the changes (since I haven't set up Ruby or a 
Jekyll environment on computer, all of my testing happens live). 

Of course, things rarely work out of the box. A quick recheck of the 
blog post revealed it was written back in 2011, and things have, um, 
changed a bit in the last six years. The basic procedure still works, 
but I'll re-explain the process with my updates.

The first two steps are the same: you need to manually create an issue 
in your blog repository's issue tracker for each blog post you publish,
and you need to add the issue number to your post's YAML front matter.
To give you some examples, 
[here](https://github.com/mkoohafkan/mkoohafkan.github.io/issues/23)
is the issue I created for this post, and 
[here](https://github.com/mkoohafkan/mkoohafkan.github.io/blob/master/_posts/2017-01-19-using-github-to-host-blog-comments.md) 
{'fraction_non_alphanumeric': 0.07152111946100026, 'fraction_numerical': 0.020730759264058048, 'mean_word_length': 4.006485084306096, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '976284', 'n_tokens_mistral': 1185, 'n_tokens_neox': 1092, 'n_words': 546}