Repo Popover¶
What it is¶
Press Ctrl+Shift+G (or hover the repo icon in the header) to open a card
showing GitHub project data: stars, forks, latest commit, language, license,
and more. The data is fetched from the GitHub API, cached for 1 hour, and
rendered as a glass panel that persists until you dismiss it.
When to use it¶
The repo popover is a quick-glance project dashboard for readers who want to check the project's health without leaving the docs. It's especially useful on docs-heavy sites where the GitHub repo link is buried in the header.
How it works¶
When the header contains a .void-header__repo link (from repo_url in
mkdocs.yml), initRepoPopover() binds hover/click/focus handlers that
fetch four GitHub API endpoints in parallel:
/repos/:owner/:nameβ stars, forks, watchers, language, license, etc./tags?per_page=1β latest tag/commits?per_page=1β latest commit (total fromLinkheader)/users/:ownerβ owner bio, followers, public repos, location
The results are cached in void-cache-repo-<owner>/<name> with a 1-hour TTL.
Data fields¶
| Field | Source |
|---|---|
| description | /repos/:owner/:name |
| owner_bio | /users/:owner |
| author | /repos/:owner/:name β owner.login |
| followers | /users/:owner β followers |
| public_repos | /users/:owner β public_repos |
| location | /users/:owner β location |
| stars | /repos/:owner/:name β stargazers_count |
| watchers | /repos/:owner/:name β subscribers_count |
| forks | /repos/:owner/:name β forks_count |
| open_issues | /repos/:owner/:name β open_issues_count |
| language | /repos/:owner/:name β language |
| license | /repos/:owner/:name β license.spdx_id |
| default_branch | /repos/:owner/:name β default_branch |
| commits | Derived from Link header on /commits |
| tags | /tags?per_page=1 β first tag name |
| latest_commit | /commits?per_page=1 β sha (short) |
| commit_msg | /commits?per_page=1 β commit.message |
| created | /repos/:owner/:name β created_at |
| updated | /repos/:owner/:name β updated_at |
| pushed | /repos/:owner/:name β pushed_at |
Configuration¶
theme:
void:
components:
repo_popover:
show: true # Enable the popover (default true)
fields: # Which fields to render (default: all)
- description
- owner_bio
- author
- followers
- public_repos
- location
- stars
- watchers
- forks
- open_issues
- language
- license
- default_branch
- commits
- tags
- latest_commit
- commit_msg
- created
- updated
- pushed
Opt out of specific sections by listing only the ones you want. The shortcut
is remappable under theme.void.keyboard.shortcuts.toggle_repo_popover.
Under the hood¶
- File:
void.jsβinitRepoPopover(config)(line ~4809),openRepoLink()(line ~5086),toggleRepoPopover()(line ~5096) - Guard: only renders when
repo_urlpoints to a GitHub host; for non-GitHub repos,Ctrl+Shift+Gopens the repo link in a new tab. - Cache:
void-cache-repo-<owner>/<name>β 1-hour TTL, genericcacheGet/cacheSethelpers. - Avatar: resolved from
https://github.com/<owner>.png?size=80β no rate limit, never stale. - Trigger: opens on
mouseenter,pointerenter,focus,click, and Enter/Space. Closes onmouseleave,focusout, outside pointer, or Escape. No auto-close timer β the card persists until dismissed.
Accessibility notes¶
- The popover is a
role="tooltip"panel with anaria-labelon the trigger. Escapecloses the popover and returns focus to the trigger.- Focus is trapped inside the popover while it's open.
- Data loading failures render a graceful error message ("Unable to load repo data") β the popover never blocks the page.