Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: automatically redirect when index is empty #437

Closed
Tahul opened this issue Jun 15, 2021 · 4 comments · Fixed by #440
Closed

feat: automatically redirect when index is empty #437

Tahul opened this issue Jun 15, 2021 · 4 comments · Fixed by #440
Labels
enhancement New feature or request

Comments

@Tahul
Copy link
Contributor

Tahul commented Jun 15, 2021

We added navigation.redirect, but the UX could be better for users.

We could automatically redirect to first file in order (0., 1. or the first in order, or the first in query if no order specified).

It could be useful because I feel that using directories index.md for configuration will be an usual pattern, and using index.md does gives an empty page that can be browser into navigation elements such as PagePrevNext component.

You can easily reproduce this by browsing the last page of a directory in which the following directory has a page index.

PagePrevNext component should also be updated I think.

Maybe displaying the name of the next/previous directory when changing categories or specifying it as usual with category name + page name.

@Tahul Tahul added the enhancement New feature or request label Jun 15, 2021
@Tahul
Copy link
Contributor Author

Tahul commented Jun 16, 2021

As an example, I would like you to get a look at this feature from @nuxt/content:
https://content.nuxtjs.org/fr/fetching#surroundslug-options

Which I think we should have, and be used in this feature.

@Tahul
Copy link
Contributor Author

Tahul commented Jun 16, 2021

I think also that an empty index.md placed at the root of a directory, without any other content than front-matter should not be treated as a page.

WDYT @farnabaz ?

Copy link
Collaborator

farnabaz commented Jun 16, 2021

https://content.nuxtjs.org/fr/fetching#surroundslug-options

This feature is what we use to fetch prev & next pages in bottom navigation

I think also that an empty index.md placed at the root of a directory, without any other content than front-matter should not be treated as a page.

What do you mean by not treating as a page? We need them in navigation hierarchy.

@atinux
Copy link
Contributor

atinux commented Jun 16, 2021

Cannot we use the navigation to do so? 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants