fix(website): map built-in entries to cpython for star data lookup

Entries with source_type 'Built-in' have no extractable GitHub repo key
from their URL, so they never received star/metadata enrichment. Fall
back to python/cpython for these entries so the star count and related
data are populated correctly.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Vinta Chen 2026-03-22 02:10:44 +08:00
parent 8e7b881659
commit 37a9443bbb
No known key found for this signature in database
GPG Key ID: B93DE4F003C33630

View File

@ -160,6 +160,8 @@ def build(repo_root: str) -> None:
stars_data = load_stars(website / "data" / "github_stars.json")
for entry in entries:
repo_key = extract_github_repo(entry["url"])
if not repo_key and entry.get("source_type") == "Built-in":
repo_key = "python/cpython"
if repo_key and repo_key in stars_data:
sd = stars_data[repo_key]
entry["stars"] = sd["stars"]