Skip to content

Commit dfffa14

Browse files
committed
fix navbar link final
1 parent 1531ff6 commit dfffa14

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

src/_includes/navbar.njk

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{% macro navbar(isHomePage = false) %}
2+
{% set baseUrl = "/2025/" if env.baseUrl === "/2025/" else "/" %}
23
<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">
34
<div class="w-full max-w-5xl mx-auto px-6 hidden md:block py-3">
45
<div class="relative flex justify-center items-center h-12 px-6">
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">
6+
<a href="{{ baseUrl }}" class="absolute left-0">
7+
<img src="{{ baseUrl }}img/logo.png" alt="PyCon India 2025" class="h-10 w-auto">
78
</a>
89
<ul class="flex items-center justify-center w-full gap-8 relative">
910
{% set menuItems = [
@@ -64,7 +65,7 @@
6465
<div class="w-full flex flex-col">
6566
{% for subitem in item.submenu %}
6667
<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">
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">
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">
6869
{{ subitem.name }}
6970
</a>
7071
<div class="size-5 relative overflow-hidden">
@@ -77,7 +78,7 @@
7778
</div>
7879
{% else %}
7980
{# TODO: item.name != 'Sponsors' is a hack till we get the sponsors page up#}
80-
<a href="{% if item.isExternal %}{{ item.link }}{% elif item.link and item.link[0] == '#' and item.name != 'Sponsors' %}{{ env.baseUrl }}/{{ item.link }}{% else %}{{ env.baseUrl }}/{{ item.link }}{% endif %}"
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 %}"
8182
{% if item.isExternal %}target="_blank" rel="noopener noreferrer"{% endif %}
8283
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">
8384
{{ item.name }}
@@ -87,16 +88,16 @@
8788
{% endfor %}
8889
</ul>
8990
<div class="absolute right-0">
90-
<a href="{{ '/tickets' | url }}" 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">
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">
9192
Get Tickets
9293
</a>
9394
</div>
9495
</div>
9596
</div>
9697

9798
<div class="flex justify-between items-center px-4 py-3 w-full md:hidden">
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">
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">
100101
</a>
101102

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

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

@@ -129,7 +130,7 @@
129130
<div class="flex flex-col space-y-4">
130131
{% for item in menuItems %}
131132
{% if not item.hasSubmenu %}
132-
<a href="{% if item.isExternal %}{{ item.link }}{% elif item.link and item.link[0] == '#' %}{{ item.link }}{% else %}{{ env.baseUrl }}/{{ item.link | url }}{% endif %}"
133+
<a href="{% if item.isExternal %}{{ item.link }}{% elif item.link and item.link[0] == '#' %}{{ item.link }}{% else %}{{ baseUrl }}{{ item.link }}{% endif %}"
133134
{% if item.isExternal %}target="_blank" rel="noopener noreferrer"{% endif %}
134135
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">
135136
{{ item.name }}
@@ -154,7 +155,7 @@
154155
<div class="hidden mt-2 mobile-submenu">
155156
<div class="bg-pycon-lime/90 backdrop-blur-sm border border-black/10 rounded-lg p-3 flex flex-col gap-2">
156157
{% for subitem in item.submenu %}
157-
<a href="{{ env.baseUrl }}/{{ subitem.link | url }}" class="p-2 text-gray-800 text-sm font-medium hover:text-[#4E62F5] transition-colors duration-200 no-underline">
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">
158159
{{ subitem.name }}
159160
</a>
160161
{% endfor %}
@@ -165,7 +166,7 @@
165166
{% endfor %}
166167

167168
<div class="mt-6">
168-
<a href="{{ '/tickets' | url }}" 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">
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">
169170
Get Tickets
170171
</a>
171172
</div>

0 commit comments

Comments
 (0)