<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Discussions on Time Friend</title><link>https://time-friend.com/en/tags/discussions/</link><description>Recent content in Discussions on Time Friend</description><generator>Hugo</generator><language>en-GB</language><lastBuildDate>Wed, 29 Jul 2026 15:15:07 +0800</lastBuildDate><atom:link href="https://time-friend.com/en/tags/discussions/index.xml" rel="self" type="application/rss+xml"/><item><title>Adding a Comment System to My Blog</title><link>https://time-friend.com/en/archive/blog-architecture-giscus/</link><pubDate>Tue, 06 May 2025 10:30:00 +0000</pubDate><guid>https://time-friend.com/en/archive/blog-architecture-giscus/</guid><description>&lt;p&gt;A blog needs comments. But I didn&amp;rsquo;t want to set up a database and moderation system just for that. Giscus is the compromise.&lt;/p&gt;
&lt;p&gt;This blog uses Giscus for comments. It&amp;rsquo;s based on GitHub Discussions. All comments live in the GitHub repo, no database needed, no third-party service.&lt;/p&gt;
&lt;h1 id="full-flow"&gt;Full Flow&lt;/h1&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;User opens article page
 ↓
Loads giscus.app/client.js
 ↓
Giscus script reads data- attributes
 ↓
Uses mapping=&amp;#34;pathname&amp;#34; to get current URL path
 ↓
Queries GitHub Discussions API for matching Discussion
 ↓
Found → renders comment box and existing comments
Not found → shows &amp;#34;leave a comment&amp;#34; input
 ↓
User writes comment → clicks submit
 ↓
Redirects to GitHub OAuth (first time only)
 ↓
Comment written to repo&amp;#39;s Discussions via API
 ↓
Giscus WebSocket listens for changes → real-time updates
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;User never leaves the page. Entire flow is seamless.&lt;/p&gt;</description></item></channel></rss>