lukasgeiter / mkdocs-awesome-pages-plugin

An MkDocs plugin that simplifies configuring page titles and their order
MIT License
490 stars 37 forks source link

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

Open nihalshah-dev opened 3 months ago

nihalshah-dev commented 3 months ago

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:

Expected Behavior:

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 commented 3 months ago

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 commented 3 months ago

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!