mirror of
https://github.com/vinta/awesome-python.git
synced 2026-05-10 08:28:40 +08:00
feat(website): surface subcategory labels as filterable tags
Entries nested under a plain-text subcategory heading (e.g. "Frameworks" inside Testing) now carry a subcategory field populated by the parser. The build pipeline collects these into a subcategories list on each merged entry, and the template renders them as tag-subcat buttons that plug into the existing data-cats filter mechanism. A dedicated .tag-subcat style distinguishes them visually from category tags, and both are hidden on mobile alongside .tag-group. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -121,7 +121,7 @@
|
||||
{% for entry in entries %}
|
||||
<tr
|
||||
class="row"
|
||||
data-cats="{{ entry.categories | join('||') }}{% if entry.source_type == 'Built-in' %}||Built-in{% endif %}"
|
||||
data-cats="{{ entry.categories | join('||') }}{% if entry.subcategories %}||{{ entry.subcategories | join('||') }}{% endif %}{% if entry.source_type == 'Built-in' %}||Built-in{% endif %}"
|
||||
data-groups="{{ entry.groups | join('||') }}"
|
||||
tabindex="0"
|
||||
aria-expanded="false"
|
||||
@@ -160,6 +160,14 @@
|
||||
<button class="tag" data-type="cat" data-value="{{ cat }}">
|
||||
{{ cat }}
|
||||
</button>
|
||||
{% endfor %} {% for subcat in entry.subcategories %}
|
||||
<button
|
||||
class="tag tag-subcat"
|
||||
data-type="cat"
|
||||
data-value="{{ subcat }}"
|
||||
>
|
||||
{{ subcat }}
|
||||
</button>
|
||||
{% endfor %}
|
||||
<button
|
||||
class="tag tag-group"
|
||||
|
||||
Reference in New Issue
Block a user