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

Wildcard Entries misbehave when used in mkdocs-nav.yml #105

Open
nihalshah-dev opened this issue Aug 8, 2024 · 2 comments
Open

Wildcard Entries misbehave when used in mkdocs-nav.yml #105

nihalshah-dev opened this issue Aug 8, 2024 · 2 comments

Comments

@nihalshah-dev
Copy link

nihalshah-dev commented Aug 8, 2024

Hello folks,

Thank you for this awesome plugin, literally😀.

Came across a bug. Not sure if it's a bug but nevertheless here's my summary -

Issue Description:

When using wildcard entries in the mkdocs-nav.yml file with the Awesome Pages Plugin, subsequent navigation titles are affected and misbehave. Specifically, the titles and structure of navigation items that come after the wildcard entry do not display as expected.

Example Configuration:

Here is an excerpt from the mkdocs-nav.yml file that demonstrates the issue:

nav:
  - 'Section A':
      - 'Overview': 'section_a/overview.md'
      - '... | section_a/docs/doc-*.md'
  - 'Section B':
      - 'Overview': 'section_b/overview.md'
      - 'Subsection 1':
          - 'Introduction': 'section_b/subsection_1/introduction.md'
          - 'Details': 'section_b/subsection_1/details.md'
      - 'Subsection 2':
          - 'Introduction': 'section_b/subsection_2/introduction.md'
          - 'Details': 'section_b/subsection_2/details.md'
  - 'Section C':
      - 'Overview': 'section_c/overview.md'
      - '... | section_c/docs/doc-*.md'
  - 'Section D':
      - 'Overview': 'section_d/overview.md'
      - 'Details': 'section_d/details.md'

Observed Behavior:

  • The titles and structure of the navigation items under Section B are not displayed correctly when a wildcard entry is used in Section A.
  • The issue seems to be caused by the way the plugin processes wildcard entries and how it interacts with subsequent navigation items.

Expected Behavior:

  • The navigation titles and structure should remain consistent and unaffected by the presence of wildcard entries.
  • The plugin should correctly process wildcard entries without interfering with the titles and structure of subsequent navigation items.

Workaround:

A temporary workaround is to explicitly list the files and their titles instead of using wildcard entries or provide title for each wild card entry(works). However, this approach is not ideal for large numbers of files and defeats the purpose of using wildcards for dynamic inclusion.

Request:

Please investigate this issue and provide a solution that allows the use of wildcard entries without affecting the titles and structure of subsequent navigation items. This enhancement would greatly improve the usability and flexibility of the plugin.

Thanks!! happy coding✌

@lukasgeiter
Copy link
Owner

The titles and structure of the navigation items under Section B are not displayed correctly when a wildcard entry is used in Section A.

Not displayed correctly in what way? Please be more specific.

@nihalshah-dev
Copy link
Author

nihalshah-dev commented Aug 12, 2024

The titles and structure of the navigation items under Section B are not displayed correctly when a wildcard entry is used in Section A.

Not displayed correctly in what way? Please be more specific.

Here works as expected. Title is set to Architecture as set in nav. (when wild cart entry is not used).
image

Here it gets ignored. The top heading of overview.md is used instead. (when wild card entry is used)
image

I hope it's understandable. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants