I like having "prettified" URLs, e.g. `example.com/foo/` instead of `example.com/foo.gmi`.
To try to achieve that, all of my content is in `page-slug/index.gmi`, but this does not
seem to play well with the templates -- no posts list is generated.
It's possible that the problem is just that I have a `/posts/index.gmi` that is taking
precedence, but, reading the README, I think that may not be it, since non-`index.gmi`
files are considered content.
So: if I use `page-slug.gmi` for file names instead, will it generate the "pretty"
`index.gmi` files? If not, is there an option to make it do so? If not that, would you
be willing to add it as a feature or at least accept a patch for it?
Regards,
Shadow53
Hi Michael,
Sorry for the delay,
On Sun Mar 28, 2021 at 3:29 AM -03, Michael Bryant wrote:
> I like having "prettified" URLs, e.g. `example.com/foo/` instead of> `example.com/foo.gmi`.> To try to achieve that, all of my content is in `page-slug/index.gmi`,> but this does not> seem to play well with the templates -- no posts list is generated.> It's possible that the problem is just that I have a `/posts/index.gmi`> that is taking> precedence, but, reading the README, I think that may not be it, since> non-`index.gmi`> files are considered content.
That's a use-case which I did not took into account. It won't work
properly. Simply because I ignore index pages entirely when getting
children (content) pages.
> If not that, would you be willing to add it as a feature or at least> accept a patch for it?
We could perhaps create a config option to make fetchChildren take this
format you use into consideration. I guess it would be really complex to
make both formats work together, so I think it's best to make it into a
config option and everyone can choose how to use it.
I have very little time lately to work on this, I you want to work on
this, I would greatly appreciate a patch :)
Thank you!
--
Gustavo Heinz
Just chiming in to say that this behavior causes bugs in clients that
have "go to parent directory" options. If you're at
example.com/foo/bar.gmi and click "go to parent", it takes you to
example.com/foo, loads index.gmi as expected, but then if you click on a
link to, say, baz.gmi, the client tries to load example.com/baz.gmi
instead of the expected and correct example.com/foo/baz.gmi. (For
reference, I previously used Agate and never had this problem.)
I am not a coder so I don't know where I'd begin with writing a patch,
just wanted to make this known.