Enabling comments
Marmite as a static site generator, doesn't have commenting features, but there are various options of external commenting systems to integrate.
- Utterances
-
Use github issues as comment system
Requires user to login to github - Giscus
-
Use Github discussions as comment system
requires user to login to github - Hatsu
-
Federated to ActivityPub
Requires a running instance
Requires user to comment from a fediverse account.
For now the easiest system is Giscus.
Setting up Giscus
- First you need to have a github repository
- if you used the starting repo you already got one.
- You can create a repository solely for comments, the blog doesn't need to be hosted on the same repo.
- The repository must be public, otherwise visitors will not be able to view the discussion.
- Install giscus app on your repo, otherwise visitors will not be able to comment and react.
- The Discussions feature must be enabled on your repository.
Now go to https://giscus.app/ and find the configuration section.
Copy the <script ... /script>
that was presented and put it in your marmite.yaml
extra:
comments:
title: Comments
source: |
<script src="https://giscus.app/client.js"
data-repo="yourrepo/blog"
data-repo-id="sdsdsd"
data-category="Announcements"
data-category-id="dfsffsdfsdfsdfsdf"
data-mapping="pathname"
data-strict="0"
data-reactions-enabled="1"
data-emit-metadata="0"
data-input-position="top"
data-theme="preferred_color_scheme"
data-lang="en"
data-loading="lazy"
crossorigin="anonymous"
async>
</script>
Setting up other comment systems
The process will be very similar, you just need to grab the required script
and tags.
extra:
comments:
title: Comments
source: |
<div id="comment-system"></div>
<script src="https://commentsystem.app/foo/bar/dothethings.js"></script>
Customizing the HTML template directly
Add templates/comments.html
to your project.
<article>
<header>{{site.extra.comments.title | default(value="Comments") }}</header>
{{site.extra.comments.source}}
</article>