I wanted to start getting feedback for my github pages hosted jekyll minima backed blog posts. These could possibly be scathing drunkards furious with my methods, so that we may enter an educational debate, or simply feedback on how to improve areas as I am always busting to elevate my code! I came across giscus and found that this was very simple to do by backing it with github discussions as follows…

Prerequisites

Create Public Discussions Repo

First create a public repo called “.discussions” in your github personal account or organisation.

.discussions Repo

Then you need to enable discussions on your github personal account or organisation.

Enable Discussions

Generate Giscus Javascript

Navigate to giscus app and enter the following details;

  • The language for your comments
  • The repo that contains your blog that you want comments on
  • I set the discussions category to be announcements
  • I chose the them to be light but you can choose what you like.
  • I pretty much chose defaults for everything else…

It will genertae some code that looks something like this:

<div class="wrapper">
  <script
    src="https://giscus.app/client.js"
    data-repo="hungovercoders-blog/datagriff"
    data-repo-id="R_kgDOJT_U2A"
    data-category="Announcements"
    data-category-id="DIC_kwDOJT_U2M4CavN-"
    data-mapping="pathname"
    data-strict="0"
    data-reactions-enabled="1"
    data-emit-metadata="0"
    data-input-position="bottom"
    data-theme="light"
    data-lang="en"
    crossorigin="anonymous"
    async
  ></script>
</div>

Add a footer file to the _includes folder of your blog repo.

Footer File Directory

Copy and paste this footer script sourced from Jekyll Minima source page into this footer file. Now add in the javascript that you generated from the giscus app. You directory structure and footer file content should look something like the below.

Footer File

Comments Now Appear on Blog

You can now see the comments functionality on this blog post in the footer below and in all my previous posts! You can now add a comment by logging in with your github account and sending me some feedback. Easy peasy.

These comments also appear in the discussions of the blog repo as this is what backs this functionality.

Discussions Blog Repo

Where you can navigate to the individual blog posts and see the comments as per the “data-mapping” setting that you applied in giscus.

Discussions Blog Post

I look forward to hearing from you!