Skip to content

Restore giscus comments on all posts - #38

Merged
aburnim merged 3 commits into
mainfrom
fix/restore-giscus-comments
Jul 28, 2026
Merged

Restore giscus comments on all posts#38
aburnim merged 3 commits into
mainfrom
fix/restore-giscus-comments

Conversation

@aburnim

@aburnim aburnim commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Problem

Comments had silently disappeared from most posts. They were never wired into the layout. Instead, {% include github-comments.html %} was pasted by hand at the bottom of each post body, and new posts stopped copying that line. Only 15 of 32 posts still had it, the most recent from February 2026.

_config.yml also defaulted posts to comments: false, so any post that forgot comments: true in its front matter got nothing either.

Fix

  • Wire giscus in through the Minimal Mistakes native comments provider, so every post gets a comment box automatically with no per-post markup
  • Flip the post default to comments: true
  • Remove the hand-pasted include from 15 posts, which would otherwise render a second, duplicate comment box
  • Pin url and baseurl explicitly

discussion_term is set to title, matching the old data-mapping="title", so existing GitHub Discussions reattach to their original posts rather than starting fresh.

Why url and baseurl are pinned

Setting repository is required by the theme's giscus include for data-repo, but it also activates jekyll-github-metadata, which then infers a wrong baseurl of /pages/diff-use and breaks every link on the site. Pinning both values overrides that inference and makes local and Pages builds behave identically. There's a comment in _config.yml explaining this so the lines don't get removed later.

Verification

Production build (JEKYLL_ENV=production bundle exec jekyll build):

  • All 34 posts render exactly one <section id="giscus-comments">
  • Zero leftover manual includes, zero posts with comments disabled
  • All homepage post links resolve to real files, zero broken
  • No /pages/diff-use references anywhere in the output

Note that comments are intentionally hidden in dev builds. The theme shows a "disabled in non-production environments" placeholder instead, so the production flag is needed to see them locally.

Expected check failures

Out of scope

_posts/2025-11-10-allhands.md and _posts/2026-02-02-allhands.md both build to /posts/allhands/, so one silently overwrites the other. Pre-existing and left alone here, since fixing it changes a published URL.

aburnim added 3 commits July 28, 2026 13:06
Wire giscus into the theme's native comments provider so every post
gets a comment box automatically. Remove the hand-pasted
github-comments include from 15 posts to avoid duplicate widgets.
Setting `repository` activates jekyll-github-metadata, which infers a
wrong baseurl without API access. Pinning both makes local and Pages
builds behave the same.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
diffuse-website d0c2bba Jul 28 2026, 08:12 PM

@aburnim
aburnim merged commit 08cbad5 into main Jul 28, 2026
2 of 3 checks passed
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.

1 participant