Skip to content

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

Merged
jdx merged 2 commits intomainfrom
docs/star-glyph
Apr 27, 2026
Merged

docs: prefix star count with ★ glyph and populate it on deploy#447
jdx merged 2 commits intomainfrom
docs/star-glyph

Conversation

@jdx
Copy link
Copy Markdown
Owner

@jdx jdx commented Apr 26, 2026

Summary

Two small changes to the docs:

  • Prefix the GitHub star count with ★ (U+2605) in the top-nav social link, so it reads "★ 4" instead of just "4".
  • 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 docs-only change that tweaks UI rendering and CI environment for the VitePress build. Main risk is minor visual/CSS regressions or unexpected behavior if GITHUB_TOKEN use affects build-time API calls/rate limits.

Overview
Improves the docs navbar GitHub star badge by prefixing the count with a glyph (added as a separate .star-glyph element) and styling it for consistent symbol rendering.

Updates the GitHub Pages docs workflow to pass GITHUB_TOKEN into the VitePress build step so stars.data.ts can query the GitHub API during deploy and avoid an empty/zero star count on the live site.

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

Two changes:

1. Prefix the star count badge with ★ (U+2605), so it reads "★ 4"
   instead of just "4" in the top-nav.

2. Pass GITHUB_TOKEN to the VitePress build step so the build-time
   data loader (`stars.data.ts`) can actually fetch the star count.
   Without it, the badge currently renders empty on the live site.
@gemini-code-assist
Copy link
Copy Markdown
Contributor

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 26, 2026

Greptile Summary

This PR fixes the blank star-count badge on the deployed docs site by (1) supplying GITHUB_TOKEN to the VitePress build step so stars.data.ts can call the GitHub API at build time, and (2) prepending a glyph (via a dedicated aria-hidden span) to the rendered count. The changes are doc/CI-only and carry negligible risk.

Confidence Score: 5/5

Safe to merge — purely cosmetic docs UI change and a CI env-var addition with no security or logic concerns.

No P0 or P1 issues found. The GITHUB_TOKEN used is the standard built-in token already granted contents:read at the workflow level. The JS change is guarded by the existing starsData.stars truthy check, so no risk of rendering 'undefined'. All three files are scoped to the docs build pipeline.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/docs.yml Adds GITHUB_TOKEN env var to the VitePress build step so stars.data.ts can hit the GitHub API at build time; uses the built-in github.token which already has contents:read from the workflow-level permissions block.
docs/.vitepress/theme/index.js Replaces direct textContent assignment with a dedicated star-glyph span (aria-hidden) prepended via append(); the existing truthy guard on starsData.stars keeps the badge hidden when the count is unavailable.
docs/.vitepress/theme/style.css Adds scoped CSS for the new .star-glyph span — sets cross-platform font-family and a 0.2em right margin to visually separate the star from the count.

Sequence Diagram

sequenceDiagram
    participant GHA as GitHub Actions
    participant VitePress as VitePress Build
    participant SD as stars.data.ts
    participant GHAPI as GitHub API
    participant Browser as User Browser

    GHA->>VitePress: aube run docs:build (env: GITHUB_TOKEN)
    VitePress->>SD: load data
    SD->>GHAPI: GET /repos/jdx/fnox (Authorization: token)
    GHAPI-->>SD: { stargazers_count: N }
    SD-->>VitePress: { stars: N }
    VitePress-->>GHA: dist/ built with star count baked in
    GHA->>GHA: Upload artifact → Deploy to Pages
    Browser->>Browser: onMounted() — starsData.stars truthy?
    Browser->>Browser: append ★ glyph + count to .star-count span
Loading

Reviews (2): Last reviewed commit: "docs: render star glyph in sans-serif sp..." | Re-trigger Greptile

Wraps the ★ in its own .star-glyph span and switches that span to
a sans-serif font. The mono digit font was rendering ★ at 0.6rem
as a tiny smudge; sans-serif keeps the glyph crisp without bumping
its size relative to the digits.
@jdx jdx enabled auto-merge (squash) April 27, 2026 00:21
@jdx jdx merged commit 09f9f66 into main Apr 27, 2026
16 checks passed
@jdx jdx deleted the docs/star-glyph branch April 27, 2026 00:26
NorthIsUp pushed a commit to NorthIsUp/fnox that referenced this pull request Apr 28, 2026
## Summary

Two small changes to the docs:

- **Prefix the GitHub star count with ★** (U+2605) in the top-nav social
link, so it reads "★ 4" instead of just "4".
- **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

- [ ] Merge → docs deploy runs → reload https://fnox.jdx.dev/ → top-nav
GitHub icon shows "★ N"

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low risk docs-only change that tweaks UI rendering and CI environment
for the VitePress build. Main risk is minor visual/CSS regressions or
unexpected behavior if `GITHUB_TOKEN` use affects build-time API
calls/rate limits.
> 
> **Overview**
> Improves the docs navbar GitHub star badge by prefixing the count with
a `★` glyph (added as a separate `.star-glyph` element) and styling it
for consistent symbol rendering.
> 
> Updates the GitHub Pages docs workflow to pass `GITHUB_TOKEN` into the
VitePress build step so `stars.data.ts` can query the GitHub API during
deploy and avoid an empty/zero star count on the live site.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
3490ece. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
jdx pushed a commit that referenced this pull request May 2, 2026
### 🚜 Refactor

- extract providers and core types into fnox-core crate by
[@jdx](https://github.com/jdx) in
[#458](#458)

### 📚 Documentation

- prefix star count with ★ glyph and populate it on deploy by
[@jdx](https://github.com/jdx) in
[#447](#447)
- add favicons and web app manifest by [@jdx](https://github.com/jdx) in
[#448](#448)

### 🔍 Other Changes

- **(docs)** remove shrill.en.dev analytics script by
[@jdx](https://github.com/jdx) in
[#457](#457)
- **(release)** add musl Linux targets for Alpine compatibility by
[@jdx](https://github.com/jdx) in
[#452](#452)
- add plausible analytics by [@jdx](https://github.com/jdx) in
[#451](#451)
- bump hk to 1.44.3 by [@jdx](https://github.com/jdx) in
[#454](#454)

### 📦️ Dependency Updates

- update autofix-ci/action action to v1.3.4 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#455](#455)
- update apple-actions/import-codesign-certs action to v7 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#456](#456)
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