Comments
To add comments into your website we recommend to use giscus, a comments system powered by GitHub Discussions. This is overall the easiest and fastest way to add comments to your website, being that you are most likely already using GitHub to host your notes.
giscus guide
To enable comments you'll need to make sure that
- Your repository is public. You can change the visibility on the Settings page of your repo. Find out more about this here.
- You have the
Discussionsfeature turned on. Here's the official GitHub tutorial on how to enable Discussions. - You have the
giscusapp installed for your repository. To do this, just follow this link and install the app for your account giving it visibility of your repository.
After that hope into the official giscus website and follow the steps under the Configuration heading to configure the script that you'll add into your notes. Just follow the instructions and setup the comments how you want them. Here's an example of the final script, in this case is the script used for this page:
<script src="https://giscus.app/client.js"
data-repo="otaleghani/kiln"
data-repo-id="R_kgDOQpz0LQ"
data-category="Comments"
data-category-id="DIC_kwDOQpz0Lc4C1ENW"
data-mapping="url"
data-strict="1"
data-reactions-enabled="1"
data-emit-metadata="0"
data-input-position="top"
data-theme="https://giscus.app/themes/custom_example.css"
data-lang="en"
data-loading="lazy"
crossorigin="anonymous"
async>
</script>
Themes
Kiln automatically tries to sync the theme of giscus with the current active theme. This allows you to have visual consistency across your site. You can find a list of all the available Themes here. This happens whenever discus get's loaded and on theme change (Light-Dark Mode).
To make this feature work you'll need to specify the --url flag on the generate command. Reason why is that the Discus iframe needs absolute URLs to load the files. As a refresher, the --url flag describes the final URL of your site, included the protocol. It is used usually for creating the Robots txt and Sitemap xml files. As an example if the final URL of your site is https://www.amazingsite.net you need to generate the website with the following command:
kiln generate --url "https://www.amazingsite.net"