Skip to content

Replace Disqus-only comments with configurable giscus integration and Disqus fallback - #36

Draft
lmmsoft with Copilot wants to merge 1 commit into
masterfrom
copilot/replace-disqus-with-github-comments
Draft

Replace Disqus-only comments with configurable giscus integration and Disqus fallback#36
lmmsoft with Copilot wants to merge 1 commit into
masterfrom
copilot/replace-disqus-with-github-comments

Conversation

Copilot AI commented Apr 11, 2026

Copy link
Copy Markdown

This PR migrates the blog from a Disqus-only comment integration to a GitHub-native path, with giscus as the primary provider and Disqus retained as fallback for safe rollout. It also introduces configuration-based provider switching to support rollback without template rewrites.

  • Comment provider abstraction

    • Added comments_provider in _config.yml (giscus | disqus).
    • Preserved existing disqus_shortname to avoid hard cutover risk.
  • giscus configuration surface

    • Added giscus config block in _config.yml:
      • repo, repo_id, category, category_id
      • mapping, strict, reactions_enabled, emit_metadata
      • input_position, theme, lang, loading
    • Keeps required IDs explicit so site behavior is deterministic before activation.
  • Template migration (_includes/comments.html)

    • Replaced Disqus-only embed with provider-aware rendering:
      • Render giscus when provider is giscus and required giscus fields are present.
      • Otherwise fall back to existing Disqus embed.
    • Added locale mapping for giscus language (cn -> zh-CN, jp -> ja, kr -> ko, else default locale/en).
{% assign comments_provider = site.comments_provider | default: 'giscus' %}
{% assign giscus_ready = site.giscus.repo and site.giscus.repo_id and site.giscus.category and site.giscus.category_id %}

{% if comments_provider == 'giscus' and giscus_ready %}
  <!-- giscus script -->
{% elsif site.disqus_shortname %}
  <!-- disqus script -->
{% endif %}

@vercel

vercel Bot commented Apr 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lmmsoft-github-io Ready Ready Preview, Comment Apr 11, 2026 9:30am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants