astrowind
astrowind copied to clipboard
Highlight of current page in Header with trailing slash broken
Hello,
Using site option trailingSlash, I believe there is a mistake in Header.astro at this line:
const currentPath = `/${trimSlash(new URL(Astro.url).pathname)}`;
Later in the page there is this code:
{ 'aw-link-active': href === currentPath },
But href is built in navigation.ts, using this code:
href: getPermalink('/contact'),
So getPermalink and trimSlash do not return the same value, for 'contact, getPermalink will return '/contact/', but the 'trimSlash' line will return '/contact'. I believe 'currentPath' sould be built the same as navigation.ts:
const currentPath = `${getPermalink(new URL(Astro.url).pathname)}`;