fix: normalize both nav urls before comparing
This commit is contained in:
parent
ef133b7dca
commit
a7e0b36d82
2 changed files with 13 additions and 4 deletions
|
@ -1,10 +1,10 @@
|
|||
---
|
||||
import IconMapper from "@components/IconMapper.astro";
|
||||
import { removeTrailingSlash } from "@utils/helpers/general.js";
|
||||
import { normalizePath } from "@utils/helpers/general.js";
|
||||
|
||||
const { url, title, icon } = Astro.props;
|
||||
const isHttp = url?.startsWith("http");
|
||||
const isActive = Astro.url.pathname === removeTrailingSlash(url);
|
||||
const isActive = normalizePath(Astro.url.pathname) === normalizePath(url);
|
||||
---
|
||||
|
||||
{
|
||||
|
|
Reference in a new issue