Skip to main content

Comments System

GitHub Discussions-powered comments for enhanced user engagement

πŸ”΄ Live Demo

Interactive Comment System

Comments are powered by GitHub Discussions and load below:

βš™οΈ Giscus Configuration

Setup Requirements

// config/giscus.yml
repo: 'your-username/your-repo'
repoId: 'R_YOUR_REPO_ID'
category: 'General'
categoryId: 'DIC_YOUR_CATEGORY_ID'
mapping: 'pathname'  # or 'url', 'title', etc.
reactionsEnabled: true
emitMetadata: false
inputPosition: 'bottom'  # or 'top'
theme: 'preferred_color_scheme'
lang: 'en'
loading: 'lazy'

GitHub Repository Setup

  1. Enable Discussions: Go to your repository Settings β†’ Features β†’ Discussions
  2. Install Giscus App: Visit giscus app and install it for your repository
  3. Get Configuration: Use giscus.app to generate your config
  4. Configure Template: Update your config/giscus.yml with the generated values

✨ Key Features

πŸ—£οΈ Rich Discussions

  • Markdown support
  • Emoji reactions
  • Threaded replies
  • Code syntax highlighting

πŸ”’ Authentication

  • GitHub OAuth login
  • No separate accounts
  • Spam protection
  • Moderation tools

🎨 Customization

  • Theme integration
  • Custom styling
  • Multiple languages
  • Responsive design

πŸ’» Usage Examples

Blog Post Integration

// In your blog post template
import GiscusComments from '@site/src/components/GiscusComments';

export default function BlogPost({ content, metadata }) {
  return (
    <Layout>
      <article>
        <h1>{metadata.title}</h1>
        <div>{content}</div>
        
        {/* Comments section */}
        <section className='margin-top--xl'>
          <h2>Comments</h2>
          <GiscusComments />
        </section>
      </article>
    </Layout>
  );
}

Documentation Pages

// In MDX documentation
---
title: Your Documentation Page
---

import GiscusComments from '@site/src/components/GiscusComments';

# Your Documentation Content

Your documentation content here...

## Questions and Feedback

<GiscusComments />

πŸ—ΊοΈ Discussion Mapping

Available Mapping Options

  • pathname: Use page path (recommended)
  • url: Use full URL
  • title: Use page title
  • og:title: Use OpenGraph title
  • specific: Use specific term
  • number: Use discussion number

πŸ”— Related Resources

Learn more about the comments system and GitHub Discussions