Files
awesome-python/website/templates/_category_nav.html
T
Vinta ChenandClaude a7df2a9f0e refactor: share the hero category nav between home and category pages
The "Browse by category" markup was duplicated in index.html and category.html, and the two copies had drifted.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-26 12:08:15 +08:00

23 lines
849 B
HTML

<nav class="hero-category-nav" aria-labelledby="hero-category-heading">
<details class="hero-category-details" open>
<summary class="hero-category-meta">
<h2 id="hero-category-heading">Browse by category</h2>
</summary>
<ul class="hero-category-links">
{% for category in nav_categories %}
<li>
<a class="hero-category-link" href="{{ category_urls[category.name] }}"
>{{ category.name }}</a
>
</li>
{% endfor %}
</ul>
</details>
<script>
// Collapse before first paint on phones, where the open list pushes the table about 1.5 screens down
if (matchMedia("(max-width: 680px)").matches) {
document.currentScript.previousElementSibling.open = false;
}
</script>
</nav>