Regarding branches page resources i see we have to put resources files at the same level than “_index”.
I understand why it’s like that, but having the option to create a folder strictly named “_index”, containing an “index” and all its resources in subfolders, like a leaf, but compiled as the branch it is, would be great for maintaining a tidy folder arborescence, as it can be a mess when those list type branch pages get loaded with resources.
This could be optional and we get to keep the flat _index files working as it is, but we could jump on a folder structure when needed.
Maybe that’s not useful in your eyes, or impractical to implement, i just wanted to share the idea, as i feel it could be a good one. I will gladly hear what you think about it.
This becomes a real problem with partials, i have a lot of partials designed to fetch data following a directory structure, like a gallery partial looking in the subfolder “gallery” of its page context :
{{ with $.ctx.Resources.GetMatch (printf "gallery/%s*" .img) }}
{{ partial "gallery" (dict "img" . "alt" "") }}
{{ end }}
This whole partial library becomes obsolete only in that case, that’s really unfortunate.
I agree about the conclusion. I have a development branch that’s reimplementing the tree structure that stores and navigates all of this. I’ll admit that I haven’t solved your particular issue in that branch (yet), but your suggestion might be a OK compromise.
But I think this would be for resources only, so it would look like:
I’ve managed to rewrite these partials with this kind of conditional :
{{ if (or $.ctx.IsSection $.ctx.IsHome) }}
...fetch resources located within the same directory
{{ else }}
...fetch resources located within subfolders
{{ end }}
If find that acceptable.
ps: .ctx is the page context of the partial passed with a dict
Feel free to close the topic, knowing that you have a dev branch implementing a solution to that is more than enough to me, sweet lord thank you so much