feat: rename Built-in source type to Stdlib and show it in downloads column

Standard-library entries rendered "Not on PyPI" in the PyPI Downloads
column, which read like missing data rather than a deliberate category
— the build already forces downloads to None for them so they never
pick up a same-named PyPI backport. They now render a "Stdlib" badge
instead, while genuine non-PyPI entries keep "Not on PyPI".

The filter tag is renamed to match, so the source-type value, the row
filter tag, and the synthetic category heading all read Stdlib now.
The literal "Built-in" strings scattered through build.py are routed
through the existing BUILTIN_FILTER constant so the label lives in one
place. The category page slug stays "built-in" so the public URL
/categories/built-in/ does not break.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Vinta Chen 2026-08-23 01:01:17 +08:00
parent b1f473319c
commit 2fc0edd565
No known key found for this signature in database
GPG key ID: B93DE4F003C33630
4 changed files with 26 additions and 24 deletions

View file

@ -138,7 +138,7 @@
{% for entry in entries %}
<tr
class="row"
data-tags="{{ entry.categories | join('||') }}{% if entry.subcategories %}||{{ entry.subcategories | map(attribute='value') | join('||') }}{% endif %}||{{ entry.groups | join('||') }}{% if entry.source_type == 'Built-in' %}||Built-in{% endif %}"
data-tags="{{ entry.categories | join('||') }}{% if entry.subcategories %}||{{ entry.subcategories | map(attribute='value') | join('||') }}{% endif %}||{{ entry.groups | join('||') }}{% if entry.source_type == 'Stdlib' %}||Stdlib{% endif %}"
tabindex="0"
aria-expanded="false"
aria-controls="expand-{{ loop.index }}"
@ -155,7 +155,8 @@
</td>
<td class="col-downloads">
{% if entry.downloads is not none %}{{
"{:,}".format(entry.downloads) }}{% else %}<span
"{:,}".format(entry.downloads) }}{% elif entry.source_type ==
'Stdlib' %}<span class="source-badge">Stdlib</span>{% else %}<span
class="source-badge"
>Not on PyPI</span
>{% endif %}
@ -207,14 +208,14 @@
{{ entry.groups[0] }}
</a>
{% endif %}
{% if entry.source_type == 'Built-in' %}
{% if entry.source_type == 'Stdlib' %}
<a
class="tag tag-source{% if '/categories/built-in/' == current_path %} active{% endif %}"
href="/categories/built-in/"
data-value="Built-in"
data-value="Stdlib"
data-url="/categories/built-in/"
>
Built-in
Stdlib
</a>
{% endif %}
</td>

View file

@ -175,7 +175,7 @@
{% for entry in entries %}
<tr
class="row"
data-tags="{{ entry.categories | join('||') }}{% if entry.subcategories %}||{{ entry.subcategories | map(attribute='value') | join('||') }}{% endif %}||{{ entry.groups | join('||') }}{% if entry.source_type == 'Built-in' %}||Built-in{% endif %}"
data-tags="{{ entry.categories | join('||') }}{% if entry.subcategories %}||{{ entry.subcategories | map(attribute='value') | join('||') }}{% endif %}||{{ entry.groups | join('||') }}{% if entry.source_type == 'Stdlib' %}||Stdlib{% endif %}"
tabindex="0"
aria-expanded="false"
aria-controls="expand-{{ loop.index }}"
@ -192,7 +192,8 @@
</td>
<td class="col-downloads">
{% if entry.downloads is not none %}{{
"{:,}".format(entry.downloads) }}{% else %}<span
"{:,}".format(entry.downloads) }}{% elif entry.source_type ==
'Stdlib' %}<span class="source-badge">Stdlib</span>{% else %}<span
class="source-badge"
>Not on PyPI</span
>{% endif %}
@ -240,14 +241,14 @@
>
{{ entry.groups[0] }}
</a>
{% if entry.source_type == 'Built-in' %}
{% if entry.source_type == 'Stdlib' %}
<a
class="tag tag-source"
href="/categories/built-in/"
data-value="Built-in"
data-value="Stdlib"
data-url="/categories/built-in/"
>
Built-in
Stdlib
</a>
{% endif %}
</td>