中文
· Hahaxiong

Zero-Cost Lazy Giscus Comments with Live Theme Sync

For developer and AI research blogs, pairing IntersectionObserver + postMessage keeps Giscus completely free of performance or database overhead:

  1. Never load giscus.app/client.js on initial page paint—inject it only when the reader scrolls within 280px of the comment container.
  2. Listen for theme toggles and dispatch postMessage({ giscus: { setConfig: { theme } } }, 'https://giscus.app') so light/dark mode switches instantaneously without reloading the iframe.

Discussion & Comments

Powered by GitHub Discussions (Giscus) · Zero DB Overhead · Markdown Supported