lukasgeiter / mkdocs-awesome-pages-plugin

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

Handling empty/non-existent directories #24

Closed londonbreed closed 3 years ago

londonbreed commented 3 years ago

Hey, great plugin! I wrote my own plugin to conditionally include some .md files according to custom criteria (using the on_files event). Sometimes this logic ends up excluding an entire folder's contents, but the folder is still listed in my "arrange:" config in my .pages for the parent folder, so awesome-pages barfs when it parses my .pages.

The easiest way to fix this, but it's hacky, is to modify the .pages in my plugin temporarily, then restore it post-build. But that's ugly.

Any better way of ignoring empty folders when building the nav tree?

lukasgeiter commented 3 years ago

You can turn the error into a warning by setting the strict option to false (see example in readme).

Beyond that, do you think there is a need for some way to turn the warning off entirely?

londonbreed commented 3 years ago

No i think that'd be fine. Could add an option to ignore empty folders, but not sure that fits in the simplicity of this thing?

londonbreed commented 3 years ago

Got it working as per your suggestion. Thanks!