How to add comments to your blog

Life
Useful
Author

Bailey Andrew

Published

December 15, 2022

How to add comments to your blog

Use giscus. When you try to add it to your blog following the instructions in the link, you should immediately get the following error:

The Error

The first issue is that you probably don’t have giscus installed. Install it.

Install it.

The second issue is that your repo probably doesn’t have discussions enabled. Go to your repo’s settings, then scroll down a bit until you see a checkmark for discussions. Click it.

The checkmark

After that, it should work:

Yay.

Then go through the rest of the page and select the options you want. It should auto-generate some html for you; mine looks like this:

<script src="https://giscus.app/client.js"
        data-repo="baileyandrew/blog"
        data-repo-id="R_kgDOInJwKg"
        data-category="Announcements"
        data-category-id="DIC_kwDOInJwKs4CTGOQ"
        data-mapping="title"
        data-strict="0"
        data-reactions-enabled="1"
        data-emit-metadata="0"
        data-input-position="top"
        data-theme="dark_protanopia"
        data-lang="en"
        data-loading="lazy"
        crossorigin="anonymous"
        async>
</script>

You can just put it in a markdown code cell in your blog at the end, and it will appear magically when pushed!