-
Step 1 · Pick an approach: Giscus / Waline / Disqus
Decide by whether you'll run a backend, and who your readers are
There are only three ways to add comments to a static site, and picking wrong is a long regret.
| Approach | How it works | Pros | Cons |
|---|---|---|---|
| Giscus | Backed by GitHub Discussions | Free, no ads, good Markdown support, data lives in your own repo | Readers need a GitHub account |
| Waline | Self-hosted (Vercel plus a database) | Anonymous comments, customisable, has an admin panel | You maintain a service and a database |
| Disqus and similar | Third-party hosted | Quick integration, anonymous comments | Ads, slow, unreliable in some regions |How to choose:
- Technical site, readers have GitHub accounts → Giscus, the default and least to maintain
- General audience, anonymous comments required → Waline
- Just want to try it → Disqus, ads accepted
What this site does, for reference: the main site deliberately has no comment box, and discussion goes to one external place instead. Concentrated discussion builds more atmosphere than comments scattered across pages, and there's nothing to moderate. Whether you add comments depends on what you're trying to accumulate.
Compliance note: a site carrying user-generated content needs a moderation process and a reporting path. Using a third-party comment service doesn't remove that responsibility.
Checklist
- One approach chosen, with a reason written down
- Confirmed the login barrier is acceptable to your readers
- You understand the moderation responsibility that comes with UGC
-
Step 2 · Integration: configure Giscus and drop it into the page
Enable Discussions, install the app, paste the parameters
Giscus in three steps:
- Enable Discussions on the repo: GitHub repo → Settings → tick Discussions (the repo must be public)
- Install the Giscus app: authorise it at giscus.app, scoped to the target repo only
- Generate the snippet: enter the repo name at giscus.app, pick the mapping (
pathnamerecommended) and copy the<script>
Drop it into the page, at the bottom of an article:
<div id="comments"></div> <script src="https://giscus.app/client.js" data-repo="youruser/yourrepo" data-repo-id="R_xxxx" data-category="Announcements" data-category-id="DIC_xxxx" data-mapping="pathname" data-theme="preferred_color_scheme" data-lang="en" crossorigin="anonymous" async> </script>Lazy load it, strongly recommended: the comment box sits at the bottom of the page, so it must not slow down first paint. Use an IntersectionObserver and insert the script once the reader scrolls down.
Dark mode:
data-theme="preferred_color_scheme"follows the system setting.Verify: open the page in a different browser, not signed in to GitHub, and confirm you see a sign-in prompt rather than an error.
Checklist
- Signed out, you see the sign-in entry point
- The comment box lazy-loads and doesn't slow first paint
- A test comment appears correctly
-
Step 3 · Comments are content: let UGC be seen too
Show comments without letting them steal weight from the main content
The value of a comment section isn't only interaction — good Q&A is itself searchable content. Plenty of people search an error message and find the answer in a comment.
Three tactics:
- Promote repeated questions into the body: anything asked more than twice in the comments gets added to the article itself, and you reply to the commenter. This is the best source of content iteration there is
- A "recent comments" module on the home or article page, so new visitors can see that people actually talk here
- Make a comment page indexable: with Giscus the comments live on GitHub and the site only embeds them. If you want them indexed under your own domain, build a display page — sync comments into a static JSON and render that
Mind the weight distribution: comment quality varies, so keep it away from the page's main headings. Body first, comments after, hierarchy clear.
Moderation and atmosphere — this decides whether the section lives or dies:
- Deal with the first piece of spam the moment it appears, not once it's everywhere
- Pin a comment saying "search before asking, and include your environment" — it measurably lifts question quality
- Your own reply speed sets the tone. Answer the first 20 comments properly and people start answering for you
Don't: turn moderation off and then stop looking. By the time you check, the section is unusable.
Checklist
- High-frequency comment questions have been folded into the article body
- There's a process for handling the first piece of spam
- You personally replied to the first 20 comments
-
Step 4 · Observation: what did comments actually bring?
Track the effect on dwell time and return visits, not the comment count
The comment count is the emptiest metric there is. What you want to know is did comments make people stay, and did they come back.
Three events:
comment_view: the comment box enters the viewport — how many people reach the bottomcomment_click: clicking sign-in or the input — how many want to take partcomment_submit: a comment is posted. Catch it with the widget's message event where you can; otherwise trust the Discussions side
Read them alongside what you already track:
| Symptom | Reading |
|---|---|
| Highcomment_view, very lowcomment_click| The barrier is too high (GitHub account) or the content didn't provoke a response |
| Lots of comments but dwell time unchanged | Interaction isn't turning into reading depth; the discussion may be shallow |
| Articles with comments have a clearly higher return rate | Comments are working; keep investing |With Giscus in particular: the submit event happens inside an iframe, so trust the Discussions side for it and only record
comment_viewandcomment_clickon the front end. Don't hack a third-party iframe for the sake of a metric.The decision: if after three months
comment_click / comment_viewis under 2%, your readers don't want a comment section — switch it off and put the effort back into content. That's exactly how this site decided, and discussion moved to one external place instead.One more thing: write the event definitions into
data/conversion.json, or whoever inherits this won't know where the numbers came from.Checklist
- comment_view / comment_click are queryable
- You compared dwell time on articles with and without comments
- The conclusion is recorded: keep investing, or switch it off