Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flat not working #76

Open
day-jeff opened this issue Jun 20, 2023 · 3 comments
Open

Flat not working #76

day-jeff opened this issue Jun 20, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@day-jeff
Copy link

day-jeff commented Jun 20, 2023

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:

  • page1
  • page2
  • page3
  • page4

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
Copy link
Owner

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

@day-jeff
Copy link
Author

day-jeff commented Jun 20, 2023

@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
Copy link
Owner

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.

@lukasgeiter lukasgeiter added the enhancement New feature or request label Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants