Tutorial: How to Add Comments to an Astro 4.0 Blog with Giscus 1.0 and GitHub 2026
Static site generators like Astro 4.0 offer blazing fast performance, but adding dynamic features like comments traditionally requires third-party services. Giscus 1.0, a lightweight comment system powered by GitHub Discussions, eliminates the need for external databases when paired with GitHub 2026’s updated OAuth and Discussions APIs. This tutorial walks you through every step to integrate Giscus comments into your Astro 4.0 blog.
Prerequisites
An existing Astro 4.0 blog project (initialized with npm create astro@4 or similar)
A GitHub 2026 account with a public repository for your blog content
Node.js 20+ installed locally
Basic familiarity with Astro components and Markdown frontmatter
Step 1: Configure GitHub 2026 for Giscus
First, you’ll need to set up GitHub Discussions and a GitHub OAuth App to authorize Giscus to read/write to your repository’s discussions.
Enable GitHub Discussions
Navigate to your blog’s…