This blog supports comments using Giscus (recommended) or Disqus. Giscus is free, privacy-friendly, and uses GitHub Discussions.
Setting Up Giscus (Recommended)
Step 1: Install Giscus GitHub App
IMPORTANT: You must install the Giscus app first!
- Go to https://github.com/apps/giscus
- Click Install or Configure
- Select your account/organization
- Choose which repositories to grant access:
- All repositories (recommended), OR
- Only select repositories → Choose
haibol2016.github.io
- Click Install or Save
- Grant the requested permissions
Step 2: Enable GitHub Discussions
- Go to your GitHub repository:
https://github.com/haibol2016/haibol2016.github.io
- Click Settings → General
- Scroll down to Features
- Check Discussions to enable it
- Click Set up discussions
Step 3: Create a Discussion Category
- In your repository, go to Discussions tab
- Create a category (e.g., “Announcements” or “General”)
- Note the category name
Step 4: Get Giscus Configuration
- Go to https://giscus.app/
- Sign in with your GitHub account
- Select your repository:
haibol2016/haibol2016.github.io
- If you see “giscus is not installed”, go back to Step 1
- Choose the discussion category you created
- Configure settings:
- Page ↔ Discussions mapping: Pathname
- Discussion category: Select your category
- Features: Enable reactions, enable input position (bottom)
- Theme: Light (or match your site theme)
- Copy the configuration values shown
Step 5: Update _config.yml
Edit _config.yml and update the giscus section with your values:
giscus:
repo: "haibol2016/haibol2016.github.io"
repo_id: "YOUR_REPO_ID" # From giscus.app
category: "Announcements" # Your category name
category_id: "YOUR_CATEGORY_ID" # From giscus.app
Step 6: Deploy
- Commit and push your changes
- Wait for GitHub Pages to rebuild
- Comments will appear at the bottom of each blog post
If you prefer Disqus:
- Sign up at https://disqus.com/
- Create a site
- Get your Disqus shortname
- In
_config.yml, comment out the giscus section and uncomment disqus:
# giscus:
# repo: "haibol2016/haibol2016.github.io"
# ...
disqus:
shortname: "your-disqus-shortname"
Customization
You can customize the comment appearance by editing _includes/comments.html:
- Change theme (light/dark)
- Adjust position
- Modify styling in the
<style> section
Troubleshooting
- “giscus is not installed on this repository”:
- Go to https://github.com/apps/giscus and install the app
- Grant access to your repository
- Wait a few minutes and try again
- Comments not showing:
- Make sure GitHub Discussions is enabled in your repository
- Verify Giscus app is installed (see above)
- Check browser console for errors
- Wrong repository: Verify the
repo field matches your GitHub repository
- Category not found: Ensure the category exists and matches exactly (case-sensitive)