refactor: extract site topbar into a shared template partial

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Vinta Chen
2026-10-26 12:08:15 +08:00
co-authored by Claude
parent aa6f632ed8
commit a1e6058986
4 changed files with 23 additions and 40 deletions
+20
View File
@@ -0,0 +1,20 @@
<nav class="hero-topbar{% if not home %} category-topbar{% endif %}" aria-label="Site">
{% if home %}
<span class="hero-brand-mini">Awesome Python</span>
{% else %}
<a href="/" class="hero-brand-mini">Awesome Python</a>
{% endif %}
<div class="hero-topbar-actions">
{% if all_projects %}
<a href="/#library-index" class="hero-topbar-link">All projects</a>
{% endif %}
<a
href="https://github.com/vinta/awesome-python/blob/master/CONTRIBUTING.md"
class="hero-topbar-link hero-topbar-link-strong"
target="_blank"
rel="noopener"
>Submit a project</a
>
<a href="/sponsorship/" class="hero-topbar-link">Sponsorship</a>
</div>
</nav>
+1 -14
View File
@@ -13,20 +13,7 @@
<div class="hero-noise" aria-hidden="true"></div>
<div class="category-hero-shell">
<nav class="hero-topbar category-topbar" aria-label="Site">
<a href="/" class="hero-brand-mini">Awesome Python</a>
<div class="hero-topbar-actions">
<a href="/#library-index" class="hero-topbar-link">All projects</a>
<a
href="https://github.com/vinta/awesome-python/blob/master/CONTRIBUTING.md"
class="hero-topbar-link hero-topbar-link-strong"
target="_blank"
rel="noopener"
>Submit a project</a
>
<a href="/sponsorship/" class="hero-topbar-link">Sponsorship</a>
</div>
</nav>
{%+ with all_projects = true %}{% include "_topbar.html" %}{% endwith +%}
<div class="category-hero-copy">
{% if parent_category %}
+1 -13
View File
@@ -9,19 +9,7 @@
<div class="hero-noise" aria-hidden="true"></div>
<div class="hero-shell">
<nav class="hero-topbar" aria-label="Site">
<span class="hero-brand-mini">Awesome Python</span>
<div class="hero-topbar-actions">
<a
href="https://github.com/vinta/awesome-python/blob/master/CONTRIBUTING.md"
class="hero-topbar-link hero-topbar-link-strong"
target="_blank"
rel="noopener"
>Submit a project</a
>
<a href="/sponsorship/" class="hero-topbar-link">Sponsorship</a>
</div>
</nav>
{%+ with home = true %}{% include "_topbar.html" %}{% endwith +%}
<div class="hero-grid">
<div class="hero-copy">
+1 -13
View File
@@ -11,19 +11,7 @@
<div class="hero-noise" aria-hidden="true"></div>
<div class="category-hero-shell">
<nav class="hero-topbar category-topbar" aria-label="Site">
<a href="/" class="hero-brand-mini">Awesome Python</a>
<div class="hero-topbar-actions">
<a
href="https://github.com/vinta/awesome-python/blob/master/CONTRIBUTING.md"
class="hero-topbar-link hero-topbar-link-strong"
target="_blank"
rel="noopener"
>Submit a project</a
>
<a href="/sponsorship/" class="hero-topbar-link">Sponsorship</a>
</div>
</nav>
{%+ include "_topbar.html" +%}
<div class="category-hero-copy sponsorship-hero-copy">
<p class="hero-kicker">Sponsorship</p>