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:
Vinta Chen
2026-05-03 07:51:39 +08:00
parent b0136ac266
commit 8e00055c8c
2 changed files with 19 additions and 6 deletions
+6
View File
@@ -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",
)