Note:
giscus is still under active development. GitHub is also still actively developing Discussions and its API. Thus, some features of giscus may break or change over time.
how it works
When giscus loads, the GitHub Discussions search API is used to find the Discussion associated with the page based on a chosen mapping (URL, pathname, <title>, etc.). If a matching discussion cannot be found, the giscus bot will automatically create a discussion the first time someone leaves a comment or reaction.
To comment, visitors must authorize the giscus app to post on their behalf using the GitHub OAuth flow. Alternatively, visitors can comment on the GitHub Discussion directly. You can moderate the comments on GitHub.
configuration
Repository
Choose the repository giscus will connect to. Make sure that:
The repository is public, otherwise your visitors will not be able to view the discussion.
The giscus app is installed on the repository, otherwise visitors will not be able to comment and react.
Choose the mapping between the embedding page and the embedded discussion.
Discussion Category
Choose the discussion category where new discussions will be created. It is recommended to use a category with the Announcements type so that new discussions can only be created by maintainers and giscus.
When searching for a matching discussion, giscus will only search in this category.
Features
Choose whether specific features should be enabled.
The reactions for the discussion's main post will be shown before the comments.
Discussion metadata will be sent periodically to the parent window. For demonstration, enable this option and open your browser's console on this page. See the documentation for more details.
Theme
Choose a theme that matches your website. Can't find one that does? Contribute a custom theme.
Enable giscus
Add the following <script> tag to your website's template where you want the comments to appear. If an element with the class giscus exists, the comments will be placed there instead.
<scriptsrc="/client.js"
data-repo="[ENTER REPO HERE]"
data-repo-id="[ENTER REPO ID HERE]"
data-category="[ENTER CATEGORY NAME HERE]"
data-category-id="[ENTER CATEGORY ID HERE]"
data-mapping="pathname"
data-reactions-enabled="1"
data-emit-metadata="0"
data-theme="light"
crossorigin="anonymous"
async></script>
You can customize the layout using the .giscus and .giscus-frame selectors.
If you've previously used other systems that utilize GitHub Issues (e.g. utterances, gitalk), you can convert the existing issues into discussions. After the conversion, just make sure that the mapping between the discussion titles and the pages are correct, then giscus will automatically use the discussions.
giscus
A comments system powered by GitHub Discussions. Let visitors leave comments and reactions on your website via GitHub! Heavily inspired by utterances.
how it works
When giscus loads, the GitHub Discussions search API is used to find the Discussion associated with the page based on a chosen mapping (URL,
pathname
,<title>
, etc.). If a matching discussion cannot be found, the giscus bot will automatically create a discussion the first time someone leaves a comment or reaction.To comment, visitors must authorize the giscus app to post on their behalf using the GitHub OAuth flow. Alternatively, visitors can comment on the GitHub Discussion directly. You can moderate the comments on GitHub.
configuration
Repository
Choose the repository giscus will connect to. Make sure that:
Page ↔️ Discussions Mapping
Choose the mapping between the embedding page and the embedded discussion.
Discussion Category
Choose the discussion category where new discussions will be created. It is recommended to use a category with the Announcements type so that new discussions can only be created by maintainers and giscus.
When searching for a matching discussion, giscus will only search in this category.
Features
Choose whether specific features should be enabled.
The reactions for the discussion's main post will be shown before the comments.
Discussion metadata will be sent periodically to the parent window. For demonstration, enable this option and open your browser's console on this page. See the documentation for more details.
Theme
Choose a theme that matches your website. Can't find one that does? Contribute a custom theme.
Enable giscus
Add the following
<script>
tag to your website's template where you want the comments to appear. If an element with the classgiscus
exists, the comments will be placed there instead.You can customize the layout using the
.giscus
and.giscus-frame
selectors.If you're using giscus, consider starring🌟 giscus on GitHub and adding the 🎉
giscus
topic to your repository!advanced usage
You can add additional configurations (e.g. allowing specific origins) by following the advanced usage guide.
To use giscus with React, Vue, or Svelte, check out the giscus component library.
migrating
If you've previously used other systems that utilize GitHub Issues (e.g. utterances, gitalk), you can convert the existing issues into discussions. After the conversion, just make sure that the mapping between the discussion titles and the pages are correct, then giscus will automatically use the discussions.
sites using giscus
contributing
See CONTRIBUTING.md
try it out👇 👇 👇