mkdocs-awesome-pages-plugin icon indicating copy to clipboard operation
mkdocs-awesome-pages-plugin copied to clipboard

Wildcard Entries misbehave when used in `mkdocs-nav.yml`

Open nihalshah-dev opened this issue 6 months ago • 2 comments

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✌

nihalshah-dev avatar Aug 08 '24 12:08 nihalshah-dev