feat(website): add source type badges for non-GitHub entries

Detect the hosting source (stdlib, GitLab, Bitbucket, External) from
the entry URL and surface it as a small badge in the stars column where
a star count would otherwise show an em dash.

Stdlib entries also get their own sort tier — between starred entries
and other no-star entries — so the standard library is not buried at
the bottom of each category.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Vinta Chen
2026-03-22 02:03:00 +08:00
parent f7b51a6207
commit 666f6e52d0
3 changed files with 41 additions and 3 deletions

View File

@@ -98,6 +98,7 @@
</td>
<td class="col-stars">
{% if entry.stars is not none %}{{ "{:,}".format(entry.stars) }}{%
elif entry.source_type %}<span class="source-badge">{{ entry.source_type }}</span>{%
else %}&mdash;{% endif %}
</td>
<td