Skip to content

Highlight of current page in Header with trailing slash broken #557

@g012

Description

@g012

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)}`;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions