mirror of
https://github.com/vinta/awesome-python.git
synced 2026-05-19 04:44:45 +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:
@@ -102,6 +102,9 @@ def extract_entries(
|
||||
existing["categories"].append(cat["name"])
|
||||
if group_name not in existing["groups"]:
|
||||
existing["groups"].append(group_name)
|
||||
subcat = entry["subcategory"]
|
||||
if subcat and subcat not in existing["subcategories"]:
|
||||
existing["subcategories"].append(subcat)
|
||||
else:
|
||||
merged = {
|
||||
"name": entry["name"],
|
||||
@@ -109,6 +112,7 @@ def extract_entries(
|
||||
"description": entry["description"],
|
||||
"categories": [cat["name"]],
|
||||
"groups": [group_name],
|
||||
"subcategories": [entry["subcategory"]] if entry["subcategory"] else [],
|
||||
"stars": None,
|
||||
"owner": None,
|
||||
"last_commit_at": None,
|
||||
|
||||
Reference in New Issue
Block a user