Skip to content
New to Sumi? Read the introduction.
Sumi
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#

  1. Turn on Discussions in your repository's settings, and install the Giscus app on it.
  2. 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-id and data-category-id values.
  3. 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#

repo
The repository that holds the discussions, owner/name. Required.
repo_id, category, category_id
From giscus.app.
mappingDefault pathname
How a page finds its discussion: pathname, url, title, og:title or specific.
strictDefault false
Match discussion titles exactly instead of by search.
reactionsDefault true
Show reactions on the main post.
input_positionDefault bottom
top puts the comment box above the comments.
langDefault the site language
The Giscus interface language.
theme_light, theme_darkDefault light, dark
The Giscus themes for each palette.
opt_inDefault false
Show comments only on pages with comments: true in their front matter.

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 comments unset for a site that must work offline.
  • Landing pages and the blog index have no comments.
  • Changing mapping later can disconnect pages from their existing discussions.
Esc
↵ to open ↑↓ to move Esc to close
Keyboard shortcuts
Ctrl K /
Open search and commands
t
Toggle dark mode
[ ]
Previous / next page
j k
Previous / next heading
- =
Narrower / wider text
o
Collapse or expand all
b
Bilingual view
?
Show this help
Bilingual view
English
简体中文