Quartz also has the ability to hook into various providers to enable readers to leave comments on your site.
As of today, only Giscus is supported out of the box but PRs to support other providers are welcome!
Providers
Giscus
First, make sure that the GitHub repository you are using for your Quartz meets the following requirements:
- TheĀ repository isĀ public, otherwise visitors will not be able to view the discussion.
- TheĀ giscusĀ app is installed, otherwise visitors will not be able to comment and react.
- TheĀ Discussions feature is turned onĀ byĀ enabling it for your repository.
Then, use the Giscus site to figure out what your repoId
and categoryId
should be. Make sure you select Announcements
for the Discussion category.
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!
Finally, in quartz.layout.ts
, edit the afterBody
field of sharedPageComponents
to include the following options but with the values you got from above:
Customization
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.
Custom CSS theme
Quartz supports custom theme for Giscus. To use a custom CSS theme, place the .css
file inside the quartz/static
folder and set the configuration values.
For example, if you have a light theme light-theme.css
, a dark theme dark-theme.css
, and your Quartz site is hosted at https://example.com/
:
Conditionally display comments
Quartz can conditionally display the comment box based on a field comments
in the frontmatter. By default, all pages will display comments, to disable it for a specific page, set comments
to false
.
---
title: Comments disabled here!
comments: false
---