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:
Vinta Chen
2026-03-23 01:04:20 +08:00
parent 1c249d4b5f
commit f2b4a7bc83
4 changed files with 30 additions and 4 deletions
+9 -1
View File
@@ -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"