Skip to content

docs: prefix star count with ★ glyph and populate it on deploy#606

Merged
jdx merged 1 commit intomainfrom
docs/star-glyph
Apr 27, 2026
Merged

docs: prefix star count with ★ glyph and populate it on deploy#606
jdx merged 1 commit intomainfrom
docs/star-glyph

Conversation

@jdx
Copy link
Copy Markdown
Owner

@jdx jdx commented Apr 27, 2026

Summary

Three small changes to the docs:

  • Wrap a ★ (U+2605) in a sans-serif .star-glyph span before the count, so the badge reads "★ N" instead of just "N". Switching to sans-serif keeps the glyph crisp at 0.6rem — the mono digit font renders ★ as a smudge at this size.
  • Add CSS for the new .star-glyph span.
  • Pass GITHUB_TOKEN to the VitePress build step. Without it, the build-time data loader in docs/.vitepress/stars.data.ts falls back to 0 and returns an empty string, so the badge currently renders blank on the live site (curl-verified). With the token set, the loader can hit the GitHub API and populate the count.

Test plan


Note

Low Risk
Low risk UI/CSS tweak plus a GitHub Actions env var change; main risk is only around the docs build step now relying on GITHUB_TOKEN for API calls/rate limits.

Overview
Docs Pages builds now pass GITHUB_TOKEN into the VitePress build so the stars.data loader can successfully query the GitHub API and populate the star badge.

The GitHub social link star badge UI is updated to render as ★ N by inserting a dedicated .star-glyph element and styling it with a sans-serif font for crisp rendering at small sizes.

Reviewed by Cursor Bugbot for commit 90998ab. Bugbot is set up for automated code reviews on this repo. Configure here.

Three small changes:

- Wrap a sans-serif ★ (U+2605) in a .star-glyph span before the
  star count, so the badge reads "★ N" instead of just "N". The
  sans-serif font keeps the glyph crisp at 0.6rem (the mono digit
  font renders ★ as a smudge at this size).
- Add CSS for the new .star-glyph span.
- Pass GITHUB_TOKEN to the VitePress build step. Without it, the
  build-time data loader (`stars.data.ts`) falls back to 0 and
  returns "", so the badge currently renders blank on the live
  site.
@gemini-code-assist
Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 27, 2026

Greptile Summary

This PR adds a ★ glyph before the GitHub star count in the nav badge, applies a sans-serif font to keep it crisp at small sizes, and fixes the live-site blank badge by passing GITHUB_TOKEN to the VitePress build step so stars.data.ts can call the GitHub API at build time.

Confidence Score: 5/5

Safe to merge — all three changes are small, correct, and limited in scope.

No logic errors or security issues found. The github.token usage is the standard pattern for CI/CD workflows and is appropriately scoped. The DOM manipulation correctly handles the empty-string case via the existing early-exit guard. CSS font fallback chain is well-formed.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/docs.yml Adds GITHUB_TOKEN: ${{ github.token }} env var to the VitePress build step so stars.data.ts can fetch live star counts from the GitHub API.
docs/.vitepress/theme/custom.css Adds .star-glyph CSS rule with a sans-serif font stack to render ★ crisply at the 0.6rem badge size.
docs/.vitepress/theme/index.ts Replaces direct textContent assignment with a star-glyph child span (aria-hidden) prepended before the star count string.

Sequence Diagram

sequenceDiagram
    participant GH as GitHub Actions
    participant Build as VitePress Build
    participant API as GitHub API
    participant Browser as User Browser

    GH->>Build: run docs:build with GITHUB_TOKEN
    Build->>API: GET /repos/jdx/usage Bearer token
    API-->>Build: stargazers_count N
    Build->>Build: formatStars(N) returns Nk string
    Build->>Build: embed starsData.stars in static bundle

    Note over Browser: On page load
    Browser->>Browser: onMounted calls addStarCount
    Browser->>Browser: create span.star-count
    Browser->>Browser: create span.star-glyph aria-hidden with star char
    Browser->>Browser: badge.append glyph and Nk text
    Browser->>Browser: githubLink.appendChild badge
    Note over Browser: Nav shows star Nk
Loading

Reviews (1): Last reviewed commit: "docs: prefix star count with ★ glyph and..." | Re-trigger Greptile

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.03%. Comparing base (7743fe1) to head (90998ab).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #606   +/-   ##
=======================================
  Coverage   79.03%   79.03%           
=======================================
  Files          48       48           
  Lines        7235     7235           
  Branches     7235     7235           
=======================================
  Hits         5718     5718           
  Misses       1140     1140           
  Partials      377      377           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jdx jdx merged commit e63c0be into main Apr 27, 2026
12 checks passed
@jdx jdx deleted the docs/star-glyph branch April 27, 2026 00:20
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