Skip to content

Scoped Tags Not Working #7896

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
4 tasks done
mmoscony opened this issue Jan 13, 2025 · 5 comments
Closed
4 tasks done

Scoped Tags Not Working #7896

mmoscony opened this issue Jan 13, 2025 · 5 comments
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open

Comments

@mmoscony
Copy link

Context

I am using mkdocs insiders

Bug description

I am trying to use the scoped tags feature on an index page to list the tagged pages associated with a subsection. My top level index page shows all tags below it as expected but when i use <!-- material/tags { scope: true } --> on an index page for a subsection i see pages listed for other subsections as well.

Related links

Reproduction

9.5.49+insiders.4.53.14-scoped-tags-issue.zip

Steps to reproduce

  1. Create mkdocs project with 3 nav pages: home, section a, section b
  2. Add the same tag name to a page under section a and a page under section b
  3. Create section a index file with <!-- material/tags { scope: true } -->
  4. Build project and observe that pages with the same tag under section b show up in section a listing despite using scope: true

Browser

No response

Before submitting

@boonedoggle
Copy link

We put a basic mkdocs-material site here that demonstrates the issue we are seeing: https://github.com/boonedoggle/mkdocs-insider-tag-scope-test

@squidfunk
Copy link
Owner

Thanks for reporting and providing the excellent minimal reproduction! Fixed in 8f05b712b. So, this turns out to be something that we did not anticipate. The problem boils down to the fact that when comparing the URLs of pages with listings and pages with tags, foo/index.md and foo.md both map to /foo/, which doesn't allow us to correctly detect scoped tags listings in subsections. Switching to File.src_uri fixes the issue.

@squidfunk squidfunk added bug Issue reports a bug resolved Issue is resolved, yet unreleased if open labels Jan 14, 2025
@squidfunk
Copy link
Owner

If you can shortly confirm that this fixes your issue, we'll issue a new release.

@boonedoggle
Copy link

@squidfunk, thanks for the quick turn! This issue is resolved on our end.

@squidfunk
Copy link
Owner

Released as part of 9.5.49+insiders-4.53.15.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open
Projects
None yet
Development

No branches or pull requests

3 participants