lukasgeiter / mkdocs-awesome-pages-plugin

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

Flat not working #76

Open day-jeff opened 1 year ago

day-jeff commented 1 year ago

I've been trying everything I can think of to make the ... | flat feature work, including dropping back to earlier versions, and I just can't figure it out.

I created a test project with the following file structure:

page1.md
page2.md
└─ sub-folder/
   ├─ page3.md
   ├─ page4.md

BTW, my goal is simply to flatten to a single list of files:

I've tried many variations of .pages files with this basic structure:

nav:
 - page1.md
 - page2.md
 - ... | flat

or

nav:
 - ... | flat

No matter what I do, including put .pages in the sub-folder or parent folder, various forms of globbing and regexes, etc., flat has no effect, and I always end up with a nav hierarchy that includes the sub-folder names. I think I'm missing some basic concept, but I can't figure out what it is. I've even tried downgrading to earlier versions of awesome-pages in case the feature broke recently.

Can you please help?

lukasgeiter commented 1 year ago

... | flat only works in the nav section of mkdocs.yml

day-jeff commented 1 year ago

@lukasgeiter: I was just returning to report that I had figured exactly that out. 😎

Our goal is to always flatten folders when there is a sub-folder of a certain name--let's call it "published". The docs in the sub-folder are coming from a different source, but we want them merged into this particular site of unpublished docs.

Can you think of a way to do that? Would it be difficult to make ... | flat work in .pages files?

lukasgeiter commented 1 year ago

I don't think there's currently a way to do that using this plugin. You're not the first asking for something like this - I'll keep this issue open as a feature request.