Support parent/parent.md as a parent/index.md alternative

I’ve been using Zola to build a wiki/knowledge base. As I start populating a section, I write each page as mypage.md, but as soon as I need to add an image to a page, I need to create a mypage folder and rename the page to mypage/index.md.

The problem is many text editors/IDE’s use only use the filename to differentiate between open files, or in VS Code’s case only mentions the parent folder if you have multiple files with the same name open. Time and time again I end up browsing my project only to discover I already had the correct index.md file open, because I can’t tell them apart.

I propose supporting an alternative index page: the name of the folder its in. Following the example above mypage/mypage.md would function the same as mypage/index.md does today (mypage/).

If mypage/index.md exists, it should be used instead, and mypage/mypage.md should work as it does right now (mypage/mypage/). That should avoid breaking most websites.

In the rare case where mypage/mypage/ from mypage/mypage.md is the desired behavior, an option could be added to disable using it as the index (Side note: I’m not sure if this is a bug right now, where the only way to create a page named index/ is to create index/index.md).

It’s also worth considering a global option to automatically create an alias for mypage/mypage/ when it’s used as an index (for backwards compatibility).

2 Likes