Giscus.md

November 24, 2024 ยท View on GitHub

Giscus

To provide the necessary values head over to https://giscus.app/ and go to the configuration section. There you can enter all the information. You will find a detailed guide on the site.

In short:

  • You need a public repository where the comments are hosted. Recommendation: Create a new repository just for the comments
  • You have to link the giscus app to at least the repository where the comments are hosted
  • You have to enable the discussion feature in the repository (see here )

After you configured everything on the site, you get the <script> tag which you could embed. The blog needs the following information.

Here you can find an example. This is how the script tag looks on giscus.

<script
	src="https://giscus.app/client.js"
	data-repo="your_username/reponame"
	data-repo-id="M9/ab=="
	data-category="General"
	data-category-id="AbC==/8_D"
	async
></script>

Configuration

In appsettings.json change following

  "Giscus": {
    "Repository": "your_username/reponame",
    "RepositoryId": "M9/ab==",
    "Category": "General",
    "CategoryId": "AbC==/8_D"
  }
PropertyTypeDescription
GiscusnodeEnables the comment section via giscus. If left empty the comment secion will not be shown.
RepositorystringPath of you github repository, example linkdotnet/Blog
RepositoryIdstringThe id provided by giscus (data-repository-id)
CategorystringThe "Category" under which the comments are histed (like "Q&A", "General", "Ideas", ...)
CategoryIdstringThe id provided by giscus (data-category-id)