Add Utterances comments to blog posts via Ferretosan/web-blog-comments#16
Draft
Add Utterances comments to blog posts via Ferretosan/web-blog-comments#16
Conversation
✅ Deploy Preview for ferretosan-web ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Co-authored-by: Ferretosan <129646624+Ferretosan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update Utterances comments integration to use dedicated repo
Add Utterances comments to blog posts via Ferretosan/web-blog-comments
Mar 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Blog posts loaded in the popup had no comments system. This wires up Utterances (GitHub Issues-backed, no ads, $0) using
Ferretosan/web-blog-commentsas the issue store.js/markdown-parser.js
UTTERANCES_REPO = "Ferretosan/web-blog-comments"andUTTERANCES_THEMEconstantsinjectUtterances(targetEl, postId)builds the<script>viacreateElement— never injected intoinnerHTML, which is required sincepopupwindowstartsetsinnerHTMLand inline scripts don't re-executeissue-term="title"withdocument.titlebriefly set toblog/<filename>(e.g.blog/newyear26.md) before the script executes; restored via the script'sload/errorevents — gives a stable, URL-independent thread per post without requiring real page navigationpopupwindowstarton every post open, so no manual removal needed between posts;injectUtterancesalso removes any lingering.utteranceselement defensivelyREADME.md
Added Comments (Utterances) section with steps to install the GitHub App on
Ferretosan/web-blog-comments(required one-time action before comments will work) and how to change the theme.Original prompt
Update the Utterances comments integration work for Ferretosan/web to use the dedicated comments repository
Ferretosan/web-blog-comments.Context:
blog/*.mdloaded via popup usingjs/markdown-parser.js.Ferretosan/web-blog-comments.Requirements:
repo="Ferretosan/web-blog-comments".document.titleif possible; if not possible, document why.Ferretosan/web-blog-commentsand remind to install the Utterances GitHub App on that repo.Acceptance criteria:
Repository: Ferretosan/web, base branch main.
The following is the prior conversation context from the user's chat exploration (may be truncated):
User: @Ferretosan/web i want to add comments to my blog posts. how could i go about doing that? please observe the code first
Assistant: I looked at your repo. Your “blog posts” are Markdown files in
blog/*.md, and they get opened in a popup viajs/markdown-parser.js(loadBlogPost()fetchesblog/${filename}and then callspopupwindowstart(html)). So the simplest place to add comments is right after the post HTML is rendered (inside that popup).3 practical ways to add comments
1) Easiest (no backend): embed a comment service per post
Add a small “comments” HTML block after
popupwindowstart(html)inloadBlogPost(). Common options:This keeps your site static and avoids building your own database/login.
2) Still simple: store comments in a GitHub Issue (write via API)
Each post maps to an issue; users submit comments that become issue comments. You’ll need a small server/proxy to avoid exposing tokens (or accept “open GitHub issue” links instead of inline posting).
3) Full custom comments (hardest): your own backend + database
You’d build endpoints like:
GET /api/comments?post=newyear26POST /api/comments(name + message + anti-spam)Where to put it in your code
In
js/markdown-parser.js, modifyloadBlogPost(filename)so it appends a comments container using the post’s hash/filename as the unique ID.Quick question (so I recommend the right approach)
Do you want anyone to comment without accounts, or are you okay requiring a GitHub account (Giscus/Utterances)?
User: i dont want ads on my website. and i tried giscus and failed horribly. i need a disqus alternative.
Assistant: If you want no ads, skip Disqus (their free tier is ad-supported) and use a self‑hostable comment system.
Best Disqus alternatives (no ads)
1) Remark42 (recommended)
<div>+ 1<script>2) Isso
3) Commento (community edition)
How it plugs into your code
Your blog post HTML is injected here:
So you add comments by appending a comments container to
htmlbefore callingpopupwindowstart()(or by inserting into#popup-contentright after).Example (Remark42 embed idea)
You’d do something like:
const pageId = blogFileToHash[filename] || filename;<div id="remark42"></div>and load the Remark42 script configured withpageIdOne question before I give exact code
Where is this site hosted (Neocities / Netlify / GitHub Pages / your own VPS)?
Self-hosted comments (Remark42/Isso) require some server somewhere (even a cheap VPS). If you tell me your hosting + whether you can run Docker, I’ll r...
This pull request was created from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.