Multiple pages in one folder?

Is there any way to get Grav to work with multiple pages being stored not in separate subfolders, but as separate .md files within one folder, particularly for a blog-style site?

I am trying to minimise the number of subfolders on my hosting account. One reason is that my webhost limits the total number of i-nodes I can use, and having each blog post in its own subfolder doubles the usage for my Grav site. The other is performance – reaching several hundred blog posts means having several hundred subfolders in one location. This leads to delays and issues when, for example, performing a directory listing in FTP and particularly for backups (which I would like to have performed automatically on a regular basis, and this takes considerably longer with excessive amounts of subfolders).

I had in mind turning\

into something more like\
1 Like

In short no.

Grav uses a combination of a folder and a markdown image to represent a single page. Also it uses multiple markdown files in the same folder as language translations for that page.

This is a problem for me, too.

I’m planing to use grav without a CP and there are some particularities that make it really hard to manage Grav this way. This need to have folders for every entry, even if they don’t need extra files, and to use the same name, is a problem. Let’s say I need to find something I wrote. I can search the files and found all of them with the same name! And to keep this structure when writing using a mobile device is awful.

There’s other issues, but I’m staying on topic.

However, I still think you guys did a great job on creating Grav. Unfortunately, some decisions aren’t so good in my opinion.

Thanks, guys.

Just FYI, you don’t need to use the same name, you can use whatever filename you wish. However the filename by default dictates the template to use, so you will have to set template: item in the frontmatter.

The folder per page is an architectural decision that we made early on. Sure it’s convenient not to have a folder for each page of content, but as soon as you start needing more complex things (like multilanguage, or associated files) the limitations quickly outweigh any potential benefits.

Also it’s really not practical to support multiple approaches, so we just picked the best one to go forward with. It’s not something that is likely to change now, just for the sake of marginal time-savings.

Hi, @rhukster!

I disagree about the limitations. We could have a folder and a file side by side. The file for the content and the folder for the related files. If both have the same name, it would be perfect. But I understand that this will not change.

May I suggest you something? This link between the filename and the template is other thing that bothers me. Instead of need to have one template variable on every frontmatter of every file, can’t we set it by folder or something like this?

It’s just a suggestion. I don’t even know if I gonna have to swallow the problems and stay with grav as it is. More I look for alternatives, more I found that Grav is closest tool to what I need, despite some problems.

Thank you for take the time to answer me.