On this page
Comments#
Sumi can show Giscus comments under docs pages and blog posts. Giscus stores each page's thread in a GitHub Discussion of your repository, so there is no database to run and no ads.
Set up#
- Turn on Discussions in your repository's settings, and install the Giscus app on it.
- Open giscus.app, enter the repository and pick a discussion category (Announcements is a good choice: only maintainers and Giscus can start threads in it). The page shows the
data-repo-idanddata-category-idvalues. - Copy them into
mkdocs.yml:
mkdocs.yml
theme:
name: sumi
comments:
provider: giscus
repo: acme/docs
repo_id: R_kgDOxxxxxx
category: Announcements
category_id: DIC_kwDOxxxxxx
Options#
How a page finds its discussion:
pathname, url, title, og:title or specific.Per page#
docs/changelog.md
---
comments: false
---
comments: false turns comments off on one page. With opt_in: true, comments: true turns them on.
What readers get#
| Output | Details |
|---|---|
| Markup | A Comments heading and an empty box after the article, before the previous/next links |
| Loading | Giscus' script is fetched only when the reader scrolls within 400 pixels of the box, so pages without readers at the bottom never load it |
| Theme | Follows the light/dark switch without reloading |
| Without JavaScript | A link to the repository's Discussions |
Limits#
- Readers need a GitHub account to comment. Everyone can read the comments.
- Comments load from giscus.app. Apart from an analytics provider you turn on, this is the only Sumi feature that talks to a third-party service. Leave
commentsunset for a site that must work offline. - Landing pages and the blog index have no comments.
- Changing
mappinglater can disconnect pages from their existing discussions.