Repository navigation
feat(blog): comments + reactions (giscus) and Cloudflare Web Analytics - #6
Merged
Merged
Conversation
Comments and upvotes run entirely on GitHub via giscus (GitHub Discussions) — no database, no build dependency, data lives in this repo's Discussions. The component is theme-synced to the site's light/dark toggle, lazy-loaded, and each post can opt out with a 'comments: false' frontmatter flag. Page views use Cloudflare Web Analytics (privacy-first, no cookies); the beacon renders only when a public token is set in src/consts.ts. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds reader engagement to blog posts, entirely on GitHub + one privacy-first analytics beacon — no database, no heavy dependency.
Comments + upvotes (giscus → GitHub Discussions)
Comments.astrorenders giscus, backed by this repo's Discussions (Announcements category, so readers can comment/react but can't open spam threads). Data and moderation live in GitHub; you reply natively.MutationObserver, lazy-loaded, styled with the site's tokens.comments: falsein frontmatter (new schema field, defaults to on). Renders on posts only.Views (Cloudflare Web Analytics)
Base.astro, matching Cloudflare's officialtype="module"snippet, emitted verbatim viais:inline.CF_BEACON_TOKENis set insrc/consts.ts, so no broken script ships otherwise. The token is a public, write-only, site-scoped id (it appears in the served HTML by design) — not a secret.github.io. Counts start once deployed to the live domain (localhost hits aren't counted).Verification
npm run buildclean. Beacon renders once per page across homepage/blog index/posts with valid JSON; giscus mounts its iframe at runtime; comments absent from the homepage.🤖 Generated with Claude Code