I've implemented two comment systems for your website. Choose one:
Giscus uses GitHub Discussions and is more modern with better features.
-
Enable GitHub Discussions on your repository:
- Go to your repo: https://github.com/pradhansmriti/pradhansmriti.github.io
- Go to Settings > General
- Scroll down to "Features" section
- Check "Discussions"
-
Get Giscus Configuration:
- Visit https://giscus.app/
- Enter your repository:
pradhansmriti/pradhansmriti.github.io - Choose "Discussion title contains page pathname"
- Select a category (or create one called "Blog Comments")
- Copy the generated values
-
Update hugo.yaml:
- Replace the empty
repoIdandcategoryIdvalues with what you got from giscus.app - The configuration is already in your
hugo.yamlfile
- Replace the empty
Uses GitHub Issues instead of Discussions.
-
Install Utterances App:
- Go to https://github.com/apps/utterances
- Click "Install" and select your repository
-
Switch to Utterances: In your
layouts/partials/comments.html, replace the content with:{{ partial "comments-utterances.html" . }} -
Update Configuration: In
hugo.yaml, comment out the giscus section and uncomment the utterances section.
- Build your site locally:
hugo server - Navigate to a blog post
- You should see the comment section at the bottom
- Comments will only appear on blog posts (in the
/post/section) - Visitors need a GitHub account to comment
- Comments are stored in your GitHub repository (Discussions or Issues)
- You can moderate comments through GitHub's interface
You can modify the styling in the comments partials by updating the <style> section.