--- const { pathname = "/" } = Astro.props; const navItems = [ { href: "/index.html", label: "Home", match: ["/index.html", "/"] }, { href: "/about.html", label: "About Us", match: ["/about.html", "/the-founders.html", "/about-us-organizations.html"], children: [ { href: "/the-founders.html", label: "The Founders" }, { href: "/about-us-organizations.html", label: "Organizations" }, ], }, { href: "/videos.html", label: "Videos", match: ["/videos.html"] }, { href: "/events.html", label: "Events", match: ["/events.html", "/services.html"], children: [{ href: "/services.html", label: "Sunday Services" }], }, { href: "/speeches/", label: "Speeches", match: ["/speeches/"] }, { href: "/contact.html", label: "Contact", match: ["/contact.html"] }, ]; function isCurrent(item) { return item.match.some((match) => { if (match === "/") { return pathname === "/"; } if (match.endsWith("/")) { return pathname.startsWith(match); } return pathname === match; }); } ---