Skip to content

Commit 40f82f9

Browse files
anistarkbhavin192
andauthored
Call for Proposals: Panel Discussion and restructure (#130)
* add: cfp navbar and talks and panel pages update: move venue under about in navbar * fix: content for cfp overview page. guidelines ref * fixed navbar highlight * Update dates on CFP pages --------- Co-authored-by: Bhavin Gandhi <[email protected]>
1 parent 8233ef3 commit 40f82f9

File tree

5 files changed

+439
-152
lines changed

5 files changed

+439
-152
lines changed

src/_includes/js.njk

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,25 +53,51 @@
5353
const currentPath = window.location.pathname;
5454
const navLinks = document.querySelectorAll('nav a');
5555
const navLabels = document.querySelectorAll('nav label.nav-link');
56-
56+
let normalizedCurrentPath = currentPath.replace(/\/$/, '') || '/';
5757
navLinks.forEach(link => {
5858
const linkPath = link.getAttribute('href');
59-
if (linkPath && (linkPath === currentPath ||
60-
(linkPath !== '/' && currentPath.startsWith(linkPath)))) {
61-
link.classList.add('active');
59+
if (linkPath) {
60+
let normalizedLinkPath = linkPath.replace(/\/$/, '') || '/';
61+
if (normalizedCurrentPath === '/' || normalizedCurrentPath === '') {
62+
if (normalizedLinkPath === '/' || normalizedLinkPath === '') {
63+
link.classList.add('active');
64+
}
65+
} else {
66+
if (normalizedLinkPath === normalizedCurrentPath ||
67+
(normalizedLinkPath !== '/' && normalizedCurrentPath.startsWith(normalizedLinkPath + '/'))) {
68+
link.classList.add('active');
69+
}
70+
}
6271
}
6372
});
6473
6574
navLabels.forEach(label => {
6675
const parent = label.closest('li');
6776
const submenuLinks = parent.querySelectorAll('.dropdown-glass a');
77+
let hasActiveSubmenu = false;
6878
submenuLinks.forEach(submenuLink => {
6979
const submenuPath = submenuLink.getAttribute('href');
70-
if (submenuPath && (submenuPath === currentPath ||
71-
(submenuPath !== '/' && currentPath.startsWith(submenuPath)))) {
72-
label.classList.add('active');
80+
if (submenuPath) {
81+
let normalizedSubmenuPath = submenuPath.replace(/\/$/, '') || '/';
82+
console.log('Checking submenu path:', normalizedSubmenuPath, 'against current:', normalizedCurrentPath);
83+
if (normalizedCurrentPath === '/' || normalizedCurrentPath === '') {
84+
return;
85+
}
86+
const isExactMatch = normalizedSubmenuPath === normalizedCurrentPath;
87+
const isPathMatch = normalizedSubmenuPath !== '/' &&
88+
normalizedSubmenuPath !== '' &&
89+
normalizedCurrentPath.startsWith(normalizedSubmenuPath + '/');
90+
91+
if (isExactMatch || isPathMatch) {
92+
hasActiveSubmenu = true;
93+
console.log('Found active submenu:', normalizedSubmenuPath);
94+
}
7395
}
7496
});
97+
if (hasActiveSubmenu) {
98+
label.classList.add('active');
99+
console.log('Activating dropdown label:', label.textContent.trim());
100+
}
75101
});
76102
77103
// Mobile menu functionality

src/_includes/navbar.njk

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,20 @@
1111
"name": "About",
1212
"hasSubmenu": true,
1313
"submenu": [
14+
{"name": "Venue", "link": "venue"},
1415
{"name": "FAQ's", "link": "about/faqs"}
1516
]
1617
},
1718
{
1819
"name": "CFP",
19-
"link": "cfp",
20-
"hasSubmenu": false
21-
},
22-
{
23-
"name": "Venue",
24-
"link": "venue",
25-
"hasSubmenu": false
20+
"hasSubmenu": true,
21+
"submenu": [
22+
{"name": "Overview", "link": "cfp"},
23+
{"name": "Talks and Workshops", "link": "cfp/talks"},
24+
{"name": "Panel Discussions", "link": "cfp/panel"},
25+
{"name": "Poster Presentations (TBA)"},
26+
{"name": "DevSprints (TBA)"}
27+
]
2628
},
2729
{
2830
"name": "Program",

0 commit comments

Comments
 (0)