mirror of
https://github.com/vinta/awesome-python.git
synced 2026-05-09 22:53:49 +08:00
fix(website): remove duplicate tag on group/category pages
The category template rendered a tag for `category.name` plus a tag for `entry.groups[0]`, which duplicated the group name on group pages where those values are identical (e.g. /categories/python-language/ showing "Python Language" twice). It also never rendered `entry.categories`, so group pages omitted each project's actual category. Mirror the index template's tag rendering on category, group, and subcategory pages, and mark whichever tag matches the current page URL as active. Pass `category_urls` and `current_path` to each render call so the template can match by URL.
This commit is contained in:
@@ -369,6 +369,8 @@ def build(repo_root: Path) -> None:
|
||||
entries=category_entries,
|
||||
total_categories=len(categories),
|
||||
page_kind="category",
|
||||
category_urls=category_urls,
|
||||
current_path=category_path(category),
|
||||
),
|
||||
encoding="utf-8",
|
||||
)
|
||||
@@ -390,6 +392,8 @@ def build(repo_root: Path) -> None:
|
||||
entries=group_entries,
|
||||
total_categories=len(categories),
|
||||
page_kind="group",
|
||||
category_urls=category_urls,
|
||||
current_path=group_path(group["slug"]),
|
||||
),
|
||||
encoding="utf-8",
|
||||
)
|
||||
@@ -425,6 +429,8 @@ def build(repo_root: Path) -> None:
|
||||
total_categories=len(categories),
|
||||
page_kind="subcategory",
|
||||
parent_category=category,
|
||||
category_urls=category_urls,
|
||||
current_path=subcategory_path(category["slug"], sub["slug"]),
|
||||
),
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user