Add Giscus to A Blog In A Private GitHub Repository

Tutorial on how to add Giscus to a blog which is hosted in a private GitHub repository.

Flo

The key to enabling Giscus comments to your blog in a private GitHub repository is creating another GitHub repository dedicated to the comments which is public. The inspiration for this idea I found in this post.

Steps

For it to work, follow these steps:

  1. Create a new public repository (e.g /flosblog-comments)
  2. Go to the Giscus Homepage
  3. Fill out the form on the website
  4. Copy the resulting script tag to your blogs template page

Example of a script tag

Giscus script component
<script src="https://giscus.app/client.js"
data-repo="devbf/flosblog-comments"
data-repo-id="R_kgDOO3W3Mw"
data-category="Announcements"
data-category-id="DIC_kwDOO3W3M84CrIVq"
data-mapping="pathname"
data-strict="0"
data-reactions-enabled="1"
data-emit-metadata="0"
data-input-position="top"
data-theme="purple-dark"
data-lang="en"
data-loading="lazy"
crossorigin="anonymous"
async>
</script>