···11+---
22+title: Comments
33+tags:
44+ - component
55+---
66+77+Quartz also has the ability to hook into various providers to enable readers to leave comments on your site.
88+99+![[giscus-example.png]]
1010+1111+As of today, only [Giscus](https://giscus.app/) is supported out of the box but PRs to support other providers are welcome!
1212+1313+## Providers
1414+1515+### Giscus
1616+1717+First, make sure that the [[setting up your GitHub repository|GitHub]] repository you are using for your Quartz meets the following requirements:
1818+1919+1. The **repository is [public](https://docs.github.com/en/github/administering-a-repository/managing-repository-settings/setting-repository-visibility#making-a-repository-public)**, otherwise visitors will not be able to view the discussion.
2020+2. The **[giscus](https://github.com/apps/giscus) app is installed**, otherwise visitors will not be able to comment and react.
2121+3. The **Discussions feature is turned on** by [enabling it for your repository](https://docs.github.com/en/github/administering-a-repository/managing-repository-settings/enabling-or-disabling-github-discussions-for-a-repository).
2222+2323+Then, use the [Giscus site](https://giscus.app/#repository) to figure out what your `repoId` and `categoryId` should be. Make sure you select `Announcements` for the Discussion category.
2424+2525+![[giscus-repo.png]]
2626+2727+![[giscus-discussion.png]]
2828+2929+After entering both your repository and selecting the discussion category, Giscus will compute some IDs that you'll need to provide back to Quartz. You won't need to manually add the script yourself as Quartz will handle that part for you but will need these values in the next step!
3030+3131+![[giscus-results.png]]
3232+3333+Finally, in `quartz.layout.ts`, edit the `afterBody` field of `sharedPageComponents` to include the following options but with the values you got from above:
3434+3535+```ts title="quartz.layout.ts"
3636+afterBody: [
3737+ Component.Comments({
3838+ provider: 'giscus',
3939+ options: {
4040+ // from data-repo
4141+ repo: 'jackyzha0/quartz',
4242+ // from data-repo-id
4343+ repoId: 'MDEwOlJlcG9zaXRvcnkzODcyMTMyMDg',
4444+ // from data-category
4545+ category: 'Announcements',
4646+ // from data-category-id
4747+ categoryId: 'DIC_kwDOFxRnmM4B-Xg6',
4848+ }
4949+ }),
5050+],
5151+```
5252+5353+### Customization
5454+5555+Quartz also exposes a few of the other Giscus options as well and you can provide them the same way `repo`, `repoId`, `category`, and `categoryId` are provided.
5656+5757+```ts
5858+type Options = {
5959+ provider: "giscus"
6060+ options: {
6161+ repo: `${string}/${string}`
6262+ repoId: string
6363+ category: string
6464+ categoryId: string
6565+6666+ // how to map pages -> discussions
6767+ // defaults to 'url'
6868+ mapping?: "url" | "title" | "og:title" | "specific" | "number" | "pathname"
6969+7070+ // use strict title matching
7171+ // defaults to true
7272+ strict?: boolean
7373+7474+ // whether to enable reactions for the main post
7575+ // defaults to true
7676+ reactionsEnabled?: boolean
7777+7878+ // where to put the comment input box relative to the comments
7979+ // defaults to 'bottom'
8080+ inputPosition?: "top" | "bottom"
8181+ }
8282+}
8383+```
docs/images/giscus-discussion.png
This is a binary file and will not be displayed.
docs/images/giscus-example.png
This is a binary file and will not be displayed.
docs/images/giscus-repo.png
This is a binary file and will not be displayed.
docs/images/giscus-results.png
This is a binary file and will not be displayed.
+1-1
docs/index.md
···31313232## 🔧 Features
33333434-- [[Obsidian compatibility]], [[full-text search]], [[graph view]], note transclusion, [[wikilinks]], [[backlinks]], [[features/Latex|Latex]], [[syntax highlighting]], [[popover previews]], [[Docker Support]], [[i18n|internationalization]] and [many more](./features) right out of the box
3434+- [[Obsidian compatibility]], [[full-text search]], [[graph view]], note transclusion, [[wikilinks]], [[backlinks]], [[features/Latex|Latex]], [[syntax highlighting]], [[popover previews]], [[Docker Support]], [[i18n|internationalization]], [[comments]] and [many more](./features) right out of the box
3535- Hot-reload for both configuration and content
3636- Simple JSX layouts and [[creating components|page components]]
3737- [[SPA Routing|Ridiculously fast page loads]] and tiny bundle sizes