Add live release version + Discord member badges to landing page#37
Merged
Conversation
Two .stat-pill badges fetch live data on page load and render in both the hero (below the CTA buttons) and the community section (under the join heading): the latest GitHub release tag from api.github.com, and the total Discord member count from the invite endpoint with_counts. Each pill ships hidden and reveals only on a successful fetch, so a failed request leaves no broken numbers or zeros. min-height on the wrapper rows reserves vertical space to avoid layout shift when pills appear.
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.
Summary
Adds two live-fetched badges to the landing page:
Each badge is rendered as a styled
.stat-pill(rounded chip, dark theme, JetBrains Mono numeric, teal accent) and ships in two locations:How it works
Browser-side
fetch()on page load. Each pill ships with thehiddenattribute and is revealed only on a successful response — a failed fetch leaves the pill hidden (no zeros, no broken numbers, no error UI).min-heighton the row wrappers reserves vertical space so the pills appearing doesn't cause layout shift.Both endpoints confirmed to send CORS headers.
Known trade-offs
Test plan
npm run buildpasses (112 pages).Diff
One file touched:
src/pages/index.astro. Adds ~30 lines of CSS, ~14 lines of hero markup, ~14 lines of community markup, ~30 lines of JS in the existing inline<script>block.