8000 landing: GitHub stars badge in the primary nav by xerj-org · Pull Request #2311 · xerj-org/xerj · GitHub
[go: up one dir, main page]

Skip to content

landing: GitHub stars badge in the primary nav - #2311

Merged
xerj-org merged 1 commit into
mainfrom
feat/landing-stars-badge
Oct 24, 2026
Merged

xerj-org merged 1 commit into
mainfrom
feat/landing-stars-badge

Conversation

@xerj-org
Copy link
Copy Markdown
Owner

Adds a live GitHub stars badge to the xerj.org header. The owner asked for this as the one exception to keeping GitHub out of the top of the page.

Preview (not production): https://preview-stars-badge.xerj.pages.dev

What changes

  • The plain GITHUB text link in the primary nav of all 203 nav pages is now the badge: GitHub mark plus the star count (★ 14.2k), linking to https://github.com/xerj-org/xerj. It replaces the link, so the nav does not get a second GitHub entry.
  • Fallback number: each page ships a real count read at build time from https://api.github.com/repos/xerj-org/xerj (stargazers_count). It is stored in scripts/seo/github_stars.json with its source and time: 14,225 stars, read 2026-10-24T02:05:55Z (Oct 23, 9:05 PM CDT). The badge is never empty and never shows a spinner.
  • Live refresh: a small block in landing/theme.js fetches the same endpoint in the browser. That file already loads on every nav page, so there are no extra requests for assets. The result is cached in localStorage (xerj.ghstars) for 10 minutes, so each browser makes at most 6 calls an hour against the 60/hour unauthenticated limit. If the call fails or is rate limited, the badge keeps the number it shipped with and logs nothing. The CSP connect-src already allows api.github.com.
  • Style: muted 1px frame with square corners and no gold, so the version button keeps the only accent. The count has a fixed min-width (7ch, tabular numbers), so the layout does not shift when the number updates.
  • scripts/seo/stars_badge.py refreshes the count and rewrites the navs. It also has --offline (rewrite without fetching) and --check. build_articles.py now uses the same badge, so its generated pages stay current.

Checks

  • Playwright on the preview: one badge per page; text ★ 14.2K (the nav is uppercase); href is the repo; clicking it opens the GitHub repo; aria-label XERJ on GitHub, 14,225 stars; the localStorage cache is filled after the live fetch.
  • No horizontal overflow at 1440 or 390 (scrollWidth equals the viewport). Nav height is the same as live xerj.org at 1440, 1280, 1024 and 390 px, so the header does not grow.
  • stars_badge --check ok (203 navs). fix_heads --check, fix_links --check and build_articles --check ok. seo_lint 206 pages, 0 gate violations. factcheck --fail-on error 0 errors. Sitemap ok. Landing node tests 28/28, including 4 new badge tests.

Note

scripts/seo/set_nav.py exists only on the open site remake stack (#1925, #1927, #1929, #1930), not on main. If that stack lands after this PR, its nav template needs the badge in place of the GITHUB link, otherwise the badge is dropped. stars_badge.py can then re-apply it with --offline.


AI disclosure: this PR was written by an AI agent (Grok Bot) at the owner's request, and checked with the scripts and browser tests listed above. Please review before merging. Nothing has been merged or deployed to production.

The plain GITHUB text link in the top nav of every page becomes a small
badge: the GitHub mark and the star count (for example 14.2k), linking to
github.com/xerj-org/xerj. The owner asked for this one exception to keeping
GitHub out of the header.

- scripts/seo/stars_badge.py reads stargazers_count from the GitHub API,
  saves it in scripts/seo/github_stars.json with the time it was read, and
  writes the badge into every primary nav (203 pages). --check verifies,
  --offline rewrites from the saved count. build_articles.py uses the same
  badge, so the generated article pages stay current.
- landing/theme.js (already loaded on every page) refreshes the number from
  api.github.com, cached in localStorage for 10 minutes, so a browser makes
  at most 6 calls an hour against the 60/hour unauthenticated limit. Any
  failure keeps the shipped number; there is no empty state or spinner.
- style.css: muted 1px frame, no gold, so it does not compete with the
  primary CTA; fixed-width count box, so a refresh causes no layout shift.
- scripts/landing/test_stars_badge.cjs covers cache, refetch and failure.

Fallback: 14,225 stars, read 2026-10-24T02:05:55Z.
@cla-bot cla-bot Bot added the cla-signed label Oct 24, 2026
@xerj-org
xerj-org merged commit 9ecba0a into main Oct 24, 2026
24 checks passed
@xerj-org
Copy link
Copy Markdown
Owner Author

Xerj Merger made the fix: replaced the plain GITHUB nav link on every xerj.org nav page with a GitHub stars badge (build-time fallback count from scripts/seo/github_stars.json, refreshed in the browser via landing/theme.js with a 10-minute localStorage cache). All checks green on 5215c08; squash-merged pinned to that head.

cursor Bot pushed a commit that referenced this pull request Oct 24, 2026
The only conflict was CHANGELOG.md. engine.rs and landing/llms-full.txt
auto-merged. Both behaviours stay.

#1981 (this branch): a flat RSS at or above the watermark releases the
breaker after 2 seconds and does not re-arm inside the 4 MiB band.
While that latch stays engaged, drain requests double from 2 seconds
up to 15 minutes unless RSS falls by more than 4 MiB. corpus index
reports eta_quality=stalled at 0/N and after 10 minutes of silence on
a phase with no denominator.

main, kept alongside that:
- #2296 / #2294: an existing index's persisted index.default_pipeline
  is copied from settings.json back into the in-memory map on boot,
  failed-index retry, and snapshot restore.
- #2303: a single-document write is acknowledged at a quorum of copies,
  with the replica-sync lock on the engine.
- #2250 / #1612: neural autoindex prints an estimated embedding time,
  and --embed-mode stays fixed at ingest. llms-full.txt keeps that
  text and the 0/N stall sentence.
- #2308 / #2305 and #2311 came in with no overlap on the drain schedule.

CHANGELOG keeps the #1981 entry and main's #2294 default_pipeline
entry. No .github file was edited.

Verified (rustc 1.97.1 (8bab26f4f 2026-07-14), from engine/):
- cargo +1.97.1 fmt -p xerj-engine -p xerj-autoindex -- --check: exit 0
- RUST_MIN_STACK=32MiB cargo +1.97.1 test --no-fail-fast -j 2
  -p xerj-engine -p xerj-autoindex -- --test-threads=2: exit 0,
  3118 passed, 0 failed, 29 ignored. Includes
  flat_rss_above_the_watermark_releases_and_does_not_rearm,
  drain_requests_back_off_when_rss_does_not_fall,
  rss_noise_around_a_flat_footprint_still_releases,
  commit_starvation_holds_a_flat_footprint_until_commit_returns, and
  a_phase_at_zero_reports_a_stall_once_nothing_completes.

Co-authored-by: xerj-org <xerj-org@users.noreply.github.com>
cursor Bot pushed a commit that referenced this pull request Oct 24, 2026
#2311 and #2313 merged to main after ce2d7af. Both ship in rc.99
because the tag goes on the merge commit. [Unreleased] stays empty.

#2313 improves #1170, which stays open: cluster mode opens
{data_dir}/_raft and replays the committed prefix before it serves.
Documents are not copied, and there is no InstallSnapshot.

#2311 replaces the primary-nav GITHUB link with a stars badge. Footers
and data-latest-tag stay V1.0.0-RC.99 / v1.0.0-rc.99. The shipped count
is 14,225, read 2026-10-24T02:05:55Z.

The window since v1.0.0-rc.98 is 93 merged pull requests.

Co-authored-by: xerj-org <xerj-org@users.noreply.github.com>
cursor Bot pushed a commit that referenced this pull request Oct 24, 2026
gen_sitemap.py --write then --check after merging #2311. /, /agent-search/,
and /for-agents move to 2026-10-24. 203 URLs, check passed.

Co-authored-by: xerj-org <xerj-org@users.noreply.github.com>
@cursor cursor Bot mentioned this pull request Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0