Skip to content
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

[bug]: include_tag does not work #198

Closed
1 task done
nonsonogio opened this issue Mar 12, 2024 · 2 comments
Closed
1 task done

[bug]: include_tag does not work #198

nonsonogio opened this issue Mar 12, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@nonsonogio
Copy link

🐛 What happened?

Pages are not excluded when include_tag is used - apparently only exclude_tag works

🔬 How to reproduce?

Configure as such:

theme:
  name: material

plugins:
  - file-filter:
      filter_nav: false
      metadata_property: visibility
      include_tag:
        - public

  - search
  - awesome-pages
  - ezlinks
  - tags:
      tags_file: tags.md

Create a page with this frontmatter:

visibility: public

The page will still be included in the build website.

🏗️ Code Sample / Log

No response

🌌 Environment (plugin version)

0.2.0

🌌 Environment (OS)

Linux

🌌 Environment (Python)

3.11.1

🌌 Environment (MkDocs)

1.5.3

📷 Screenshots

No response

📈 Expected behavior

Error 404 when trying to access the "private" page i.e. any page WITHOUT the visibility:public in the frontmatter

📎 Additional context

No response

📜 Code of Conduct

  • I agree to follow this project's Code of Conduct.
@nonsonogio nonsonogio added the bug Something isn't working label Mar 12, 2024
@DariuszPorowski
Copy link
Owner

DariuszPorowski commented Mar 12, 2024

Hi @nonsonogio
It's expected behavior, see: https://github.com/DariuszPorowski/mkdocs-file-filter-plugin?tab=readme-ov-file#conflict-behavior

"include has higher priority over exclude"

You have to add to your config exclude_glob or exclude_regex - depends on the case. i.e.:

exclude_regex:
 - '.*\.md$'

@nonsonogio
Copy link
Author

Hello Dariusz, many thanks for clarifications, I confirm it works as you say.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants