Skip to content
Blog post thumbnail: Building a Dynamic Comment System on a Static Site: Giscus + GraphQL API - Learn how I implemented comment counts, recent comments, and an all comments page on my Hugo static blog using GitHub GraphQL API and smart caching strategies for optimal performance and UX. (https://www.codeslog.com/en/posts/blog-comment-visibility-features/)

Building a Dynamic Comment System on a Static Site: Giscus + GraphQL API

Introduction Blogs built with Static Site Generators (SSG) are incredibly fast and secure. However, adding dynamic features like comments requires careful consideration. This blog uses Giscus, a GitHub Discussions-based comment system, but there was one inconvenience. Comments only appear at the bottom of each post, making it difficult to see at a glance which articles have active discussions. So I built three features: Display comment counts in post lists - See which articles have ongoing conversations Show recent comments on the explore page - View recent blog activity at a glance Create an all comments page - Browse all comments in one place This article shares the process of bringing dynamic comment information to a static site using GitHub GraphQL API while maintaining optimal performance. ...

Published date: 2026-01-16 · Reading time: 15 min · Word count: 7440 words · Author: Isaac
Blog post thumbnail: Code Block Accessibility Improvement: Line Numbers That Screen Reader Users Can Choose - We've improved the accessibility of code blocks in our Hugo blog for screen reader users. (https://www.codeslog.com/en/posts/code-block-accessibility-improvement/)

Code Block Accessibility Improvement: Line Numbers That Screen Reader Users Can Choose

Introduction Recently, I started building and operating a blog using Hugo with the PaperMod theme. Using someone else’s theme has the advantage of quick setup, but not everything fits my needs perfectly. After customizing many parts to match my preferences, I noticed some issues with the code blocks. Line numbers were implemented with <table> tags. While this doesn’t violate accessibility guidelines, it felt not semantic. Moreover, I wondered: what’s the experience for screen reader users? I found a better approach using CSS Counters. ...