
- Published on
Analog User Guide - Comment System
Analog support multiple comment systems. You can choose the one that fits your needs. The following comment systems are provided by timlrx/pliny. Please refer to its README for a complete list of supported plugins and their configuration details.
Now, let's demonstrate how to set up a comment system using Giscus as an example.
Giscus
Giscus is a comments widget built on top of GitHub Discussions. It's a free and open-source project.
Create a Giscus Instance
First, go to Giscus and set it up per the instructions.
Note that, please make sure that:
- 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.
If everything is set up correctly, it will generate a script code snippet for you, like this:
<script src="https://giscus.app/client.js"
data-repo="repo-owner/repo-name"
data-repo-id="X_xxxxxxxxxx"
data-category="Announcements"
data-category-id="XXX_xxxxxxxxxxxxxxxx"
data-mapping="pathname"
data-strict="0"
data-reactions-enabled="1"
data-emit-metadata="0"
data-input-position="bottom"
data-theme="preferred_color_scheme"
data-lang="en"
crossorigin="anonymous"
async>
</script>
Configure Giscus in Analog
Next, fill in the corresponding comment
fields in the user configuration file /data/site-config.ts
:
comment: {
provider: 'giscus',
giscusConfig: {
repo: 'repo-owner/repo-name',
repoId: 'X_xxxxxxxxxx',
category: 'Announcements',
categoryId: 'XXX_xxxxxxxxxxxxxxxx',
...
},
}
Now, you can see the Giscus comment widget at the bottom of your posts (just like this post).
See Also
The comment system in Analog is driven by the timlrx/pliny. Please visit it for more detailed configurations.
Analog User Guide - Comment System