Skip to content

Forum: read-only, SEO-indexed mirror of GitHub Discussions#30

Merged
HumbleBee14 merged 8 commits into
mainfrom
feature/forum
Jul 17, 2026
Merged

Forum: read-only, SEO-indexed mirror of GitHub Discussions#30
HumbleBee14 merged 8 commits into
mainfrom
feature/forum

Conversation

@HumbleBee14

Copy link
Copy Markdown
Member

A community forum where all writing happens on GitHub (topics + comments + moderation + @mentions), and the site is a read-only, SEO-indexed mirror. Good Q&A pulls people in from Google.

How it works

  • Build time: src/lib/forum.ts fetches discussions + comments via GitHub GraphQL (bodyHTML, so @mentions/code/images render exactly as GitHub does) and bakes them into static HTML. Fully defensive — no token, a fetch error, or empty Discussions all yield an empty forum (warning, never a broken build).
  • On open: a small script refreshes comments from /api/discussion/[number] (a token-holding Cloudflare Function proxy) so anything posted since the last build appears. Any failure leaves the baked-in comments in place. Progressive enhancement — data is always in the HTML.

Pages

  • /forum — all threads, paginated (reuses Pager), with category chips.
  • /forum/c/[category] — per-category hub, paginated (SEO surface per section).
  • /forum/[category]/[slug] — thread: original post + comments (capped 50, commentCount reports the true total), DiscussionForumPosting/QAPage schema.org, "Reply on GitHub" CTA.

Categories

Auto-discovered from GitHub — nothing hardcoded. The giscus Comments category is excluded (those are blog comments, not forum threads).

Freshness

.github/workflows/forum-sync.yml fires the Cloudflare Deploy Hook on discussion/discussion_comment events + a daily cron.

Setup needed to go live

  • GITHUB_TOKEN (read-only) in the Cloudflare Pages build env and Functions env.
  • CLOUDFLARE_DEPLOY_HOOK_URL repo secret for the sync workflow.

Verified: builds green with no token (empty state) and with a real token; confirmed a real discussion renders as a thread with baked-in comments + schema.org + live-refresh hook. 62 tests pass.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 17, 2026

Copy link
Copy Markdown

Deploying mlsystems with  Cloudflare Pages  Cloudflare Pages

Latest commit: f1a05cf
Status:⚡️  Build in progress...

View logs

@github-actions

Copy link
Copy Markdown

@HumbleBee14
HumbleBee14 merged commit 06a87ab into main Jul 17, 2026
1 of 2 checks passed
@HumbleBee14
HumbleBee14 deleted the feature/forum branch July 17, 2026 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant