lukasgeiter / mkdocs-awesome-pages-plugin

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

Allow to collapse even with multiple children #93

Open dentou opened 10 months ago

dentou commented 10 months ago

This PR introduces an additional flag force_collapse to allow a section to collapse even if it has multiple children, which is a simple workaround for the issue in #53.

Considering the example in the issue above, the original file structure is as follows:

.
└── projects/
    └── project_name/
        └── docs/
            ├── page1.md
            ├── page2.md
            └── subdir/
                └── page3.md

The generated structure would be:

To move everything within Docs up one level, put a .pages file inside the docs folder with the following contents:

collapse: true
force_collapse: true

The new structure would be:

which is the desired outcome described in #53.