Getting Disqus to Work With Jekyll and gh-pages
Since I migrated from Blogger to jekyll based site with gh-pages, I needed a channel for comments and discussions. I had used Disqus in my previous blog. So, I thought of using it again for my new blog.
##Getting Started
Simple steps to get Disqus working on jekyll with gh-pages. Two parts:
- Disqus and
- Jekyll
###Disqus
- Log into Disqus
- Goto
Settings
>Admin
> on the left side dropdown menu, selectAdd a new site
. - Give your site name and a
shortname
, which will be your unique Disqus URL. - Get the Universal Code and copy the snippet.
###Jekyll
####Step 1:
Your gh-pages
may have the following hierarchy:
####Step 2:
Create a file _includes/comments.html
and include the copied content from Disqus Universal Code in the file as below.
Please make sure you comment the developer variable to run it live!
####Step 3:
In the _layouts/default.html
file include the comments file just created as below. Refer _layouts/default.html
####Step 4:
Make sure all the posts within _posts
have comments:true
in the frontmatter.
You are now good to go!
Happy discussing! :)