Skip to content

Links in left sidebar are active even when not on linked page #1159

@Arad1el

Description

@Arad1el

What happened?

The logic for the left sidebar links sets them as active when the name of the current page matches the name of the linked page.
This means that, given two pages with the same name, where only one should appear in the left sidebar, the link is active on both of those pages.

In the minimal reproducible example:
/p/imposter/ does not reference the menu, but the link is active
/imposter/ is the page that the link refers to

I've already made a PR for this issue, so that it instead compares the URLs of the pages: #1153

Hugo version

0.146.7 extended

Theme version

3.3.0

What browsers are you seeing the problem on?

Firefox, Chrome, Safari, Microsoft Edge

More information about the browser

Not relevant

Relevant log output

Link to Minimal Reproducible Example

https://github.com/Arad1el/stack-sidebar

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions