Skip to content

Commit 6478111

Browse files
vintaclaude
andcommitted
feat(website): add Browse by category nav to group page hero
Co-Authored-By: Claude <noreply@anthropic.com>
1 parent b82a254 commit 6478111

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

website/build.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,7 @@ def build(repo_root: Path) -> None:
406406
category_urls=category_urls,
407407
current_path=group_path(group["slug"]),
408408
filter_urls_json=filter_urls_json,
409+
group_categories=group["categories"],
409410
),
410411
encoding="utf-8",
411412
)

website/templates/category.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,23 @@ <h1>{{ category.name }}</h1>
3434
<p class="category-subtitle">{{ category.description_html | safe }}</p>
3535
{% endif %}
3636
</div>
37+
38+
{% if group_categories %}
39+
<nav class="hero-category-nav" aria-labelledby="hero-category-heading">
40+
<div class="hero-category-meta">
41+
<h2 id="hero-category-heading">Browse by category</h2>
42+
</div>
43+
<ul class="hero-category-links">
44+
{% for sub in group_categories %}
45+
<li>
46+
<a class="hero-category-link" href="{{ category_urls[sub.name] }}"
47+
>{{ sub.name }}</a
48+
>
49+
</li>
50+
{% endfor %}
51+
</ul>
52+
</nav>
53+
{% endif %}
3754
</div>
3855
</header>
3956
{% endblock %}

0 commit comments

Comments
 (0)