~gsthnz/public-inbox

2 2

Posts list with index.gmi output

Michael Bryant <shadow53@shadow53.com>
Details
Message ID
<xyJWadnxK5mgpk_Hz0wCT8zdJ3i0L6J-DmgNDpt0hKsfDoGxA__fnOM_l5vkMy3aOW_RHpEa-rRkvnfc3o_mQQwG1CHEJVHTf8rOHpRWElc=@shadow53.com>
DKIM signature
missing
Download raw message
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
Details
Message ID
<CAAWPYM9FGPA.FH72SRAU7C7C@odin>
In-Reply-To
<xyJWadnxK5mgpk_Hz0wCT8zdJ3i0L6J-DmgNDpt0hKsfDoGxA__fnOM_l5vkMy3aOW_RHpEa-rRkvnfc3o_mQQwG1CHEJVHTf8rOHpRWElc=@shadow53.com> (view parent)
DKIM signature
missing
Download raw message
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
Details
Message ID
<e844d32a-a81c-5684-b655-f63a00e06e41@locrian.zone>
In-Reply-To
<CAAWPYM9FGPA.FH72SRAU7C7C@odin> (view parent)
DKIM signature
missing
Download raw message
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.
Reply to thread Export thread (mbox)