Skip to content

Commit 13627d8

Browse files
committed
fix navbar link final final
1 parent dfffa14 commit 13627d8

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

src/_includes/navbar.njk

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
{% macro navbar(isHomePage = false) %}
2-
{% set baseUrl = "/2025/" if env.baseUrl === "/2025/" else "/" %}
1+
{% macro navbar(isHomePage = false, env = env) %}
32
<nav class="w-full flex justify-center glass-nav {% if isHomePage %}bg-transparent opacity-0 -translate-y-full{% else %}bg-pycon-blue/70{% endif %} z-50 fixed top-0 transition-all duration-500" id="main-navbar">
43
<div class="w-full max-w-5xl mx-auto px-6 hidden md:block py-3">
54
<div class="relative flex justify-center items-center h-12 px-6">
6-
<a href="{{ baseUrl }}" class="absolute left-0">
7-
<img src="{{ baseUrl }}img/logo.png" alt="PyCon India 2025" class="h-10 w-auto">
5+
<a href="{{ env.baseUrl }}" class="absolute left-0">
6+
<img src="{{ env.baseUrl }}img/logo.png" alt="PyCon India 2025" class="h-10 w-auto">
87
</a>
98
<ul class="flex items-center justify-center w-full gap-8 relative">
109
{% set menuItems = [
@@ -65,7 +64,7 @@
6564
<div class="w-full flex flex-col">
6665
{% for subitem in item.submenu %}
6766
<div class="w-full p-4 bg-white/90 hover:bg-pycon-lime border-b border-black/10 flex justify-between items-center transition-colors duration-150 first:rounded-t-lg last:rounded-b-lg last:border-b-0">
68-
<a href="{{ baseUrl }}{{ subitem.link }}" class="text-gray-800 hover:text-[#4662ff] text-sm font-medium font-['Inter'] leading-tight no-underline dropdown-item block w-full">
67+
<a href="{{ env.baseUrl }}{{ subitem.link }}" class="text-gray-800 hover:text-[#4662ff] text-sm font-medium font-['Inter'] leading-tight no-underline dropdown-item block w-full">
6968
{{ subitem.name }}
7069
</a>
7170
<div class="size-5 relative overflow-hidden">
@@ -78,7 +77,7 @@
7877
</div>
7978
{% else %}
8079
{# TODO: item.name != 'Sponsors' is a hack till we get the sponsors page up#}
81-
<a href="{% if item.isExternal %}{{ item.link }}{% elif item.link and item.link[0] == '#' and item.name != 'Sponsors' %}{{ item.link }}{% else %}{{ baseUrl }}{{ item.link }}{% endif %}"
80+
<a href="{% if item.isExternal %}{{ item.link }}{% elif item.link and item.link[0] == '#' and item.name != 'Sponsors' %}{{ item.link }}{% else %}{{ env.baseUrl }}{{ item.link }}{% endif %}"
8281
{% if item.isExternal %}target="_blank" rel="noopener noreferrer"{% endif %}
8382
class="flex items-center gap-1 py-2 px-3 text-white hover:text-[#D7FF7B] text-base font-normal font-['Acid_Grotesk'] leading-tight transition-colors duration-200 no-underline nav-link">
8483
{{ item.name }}
@@ -88,16 +87,16 @@
8887
{% endfor %}
8988
</ul>
9089
<div class="absolute right-0">
91-
<a href="{{ baseUrl }}tickets" class="font-medium text-black bg-pycon-lime/90 hover:bg-pycon-lime text-sm py-2 px-4 rounded-full transition-all duration-200 no-underline nav-button">
90+
<a href="{{ env.baseUrl }}tickets" class="font-medium text-black bg-pycon-lime/90 hover:bg-pycon-lime text-sm py-2 px-4 rounded-full transition-all duration-200 no-underline nav-button">
9291
Get Tickets
9392
</a>
9493
</div>
9594
</div>
9695
</div>
9796

9897
<div class="flex justify-between items-center px-4 py-3 w-full md:hidden">
99-
<a href="{{ baseUrl }}" class="flex items-center z-20">
100-
<img src="{{ baseUrl }}img/logo.png" alt="PyCon India 2025" class="h-8 w-auto">
98+
<a href="{{ env.baseUrl }}" class="flex items-center z-20">
99+
<img src="{{ env.baseUrl }}img/logo.png" alt="PyCon India 2025" class="h-8 w-auto">
101100
</a>
102101

103102
<input type="checkbox" id="mobile-menu-checkbox" class="hidden">
@@ -112,8 +111,8 @@
112111

113112
<div id="mobile-menu" class="fixed inset-0 bg-pycon-blue/95 backdrop-blur-md z-[1000] hidden overflow-auto">
114113
<div class="text-center pt-6 pb-4">
115-
<a href="{{ baseUrl }}" class="inline-block">
116-
<img src="{{ baseUrl }}img/logo.png" alt="PyCon India 2025" class="h-12 w-auto">
114+
<a href="{{ env.baseUrl }}" class="inline-block">
115+
<img src="{{ env.baseUrl }}img/logo.png" alt="PyCon India 2025" class="h-12 w-auto">
117116
</a>
118117
</div>
119118

@@ -130,7 +129,7 @@
130129
<div class="flex flex-col space-y-4">
131130
{% for item in menuItems %}
132131
{% if not item.hasSubmenu %}
133-
<a href="{% if item.isExternal %}{{ item.link }}{% elif item.link and item.link[0] == '#' %}{{ item.link }}{% else %}{{ baseUrl }}{{ item.link }}{% endif %}"
132+
<a href="{% if item.isExternal %}{{ item.link }}{% elif item.link and item.link[0] == '#' %}{{ item.link }}{% else %}{{ env.baseUrl }}{{ item.link }}{% endif %}"
134133
{% if item.isExternal %}target="_blank" rel="noopener noreferrer"{% endif %}
135134
class="p-4 bg-white/10 backdrop-blur-sm border border-white/20 rounded-lg hover:bg-white/20 flex justify-between items-center transition-all duration-200 text-white text-base font-medium no-underline">
136135
{{ item.name }}
@@ -155,7 +154,7 @@
155154
<div class="hidden mt-2 mobile-submenu">
156155
<div class="bg-pycon-lime/90 backdrop-blur-sm border border-black/10 rounded-lg p-3 flex flex-col gap-2">
157156
{% for subitem in item.submenu %}
158-
<a href="{{ baseUrl }}{{ subitem.link }}" class="p-2 text-gray-800 text-sm font-medium hover:text-[#4E62F5] transition-colors duration-200 no-underline">
157+
<a href="{{ env.baseUrl }}{{ subitem.link }}" class="p-2 text-gray-800 text-sm font-medium hover:text-[#4E62F5] transition-colors duration-200 no-underline">
159158
{{ subitem.name }}
160159
</a>
161160
{% endfor %}
@@ -166,7 +165,7 @@
166165
{% endfor %}
167166

168167
<div class="mt-6">
169-
<a href="{{ baseUrl }}tickets" class="flex justify-center items-center bg-pycon-lime text-black font-medium rounded-lg p-4 text-center w-full no-underline text-base transition-all duration-200 hover:bg-pycon-lime/80">
168+
<a href="{{ env.baseUrl }}tickets" class="flex justify-center items-center bg-pycon-lime text-black font-medium rounded-lg p-4 text-center w-full no-underline text-base transition-all duration-200 hover:bg-pycon-lime/80">
170169
Get Tickets
171170
</a>
172171
</div>

src/_layouts/base.njk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</head>
66
<body id="top" class="font-sans text-gray-800 min-h-screen flex flex-col {% if isFront %}is-home-page{% endif %}">
77
{% from "navbar.njk" import navbar %}
8-
{{ navbar(isFront) }}
8+
{{ navbar(isFront, env) }}
99

1010
{{ content | safe }}
1111

0 commit comments

Comments
 (0)