feat(website): add social proof line to hero with star count and build date

Display the awesome-python repo's star count (formatted as '230k+') and
the last data refresh date below the hero CTA. Fetches the self-repo
star count by always including vinta/awesome-python in the stars fetch.
Also removes the footer date stamp, which is now surfaced in the hero.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Vinta Chen
2026-03-23 01:56:15 +08:00
parent 25a3f4d903
commit f27b7c80fb
7 changed files with 51 additions and 13 deletions
+12
View File
@@ -126,6 +126,13 @@ def extract_entries(
return entries
def format_stars_short(stars: int) -> str:
"""Format star count as compact string like '230k'."""
if stars >= 1000:
return f"{stars // 1000}k"
return str(stars)
def build(repo_root: str) -> None:
"""Main build: parse README, render single-page HTML via Jinja2 templates."""
repo = Path(repo_root)
@@ -146,6 +153,10 @@ def build(repo_root: str) -> None:
entries = extract_entries(categories, parsed_groups)
stars_data = load_stars(website / "data" / "github_stars.json")
repo_self = stars_data.get("vinta/awesome-python", {})
repo_stars = format_stars_short(repo_self["stars"]) if "stars" in repo_self else None
for entry in entries:
repo_key = extract_github_repo(entry["url"])
if not repo_key and entry.get("source_type") == "Built-in":
@@ -176,6 +187,7 @@ def build(repo_root: str) -> None:
entries=entries,
total_entries=total_entries,
total_categories=len(categories),
repo_stars=repo_stars,
build_date=datetime.now(timezone.utc).strftime("%B %d, %Y"),
),
encoding="utf-8",