shuding / nextra

Simple, powerful and flexible site generation framework with everything you love from Next.js.
https://nextra.site
MIT License
11.71k stars 1.27k forks source link

[nextra-theme-docs] Better navigation with breadcrumbs #666

Open dimaMachina opened 2 years ago

dimaMachina commented 2 years ago

Currently, navigation with breadcrumbs can be accessible only if there is index page. I guess we can improve it

image
shuding commented 2 years ago

You can have this structure to make the folder work like a page:

introudction.mdx
introduction/
  a.mdx
  b.mdx

And then in the breadcrumb "Introduction" will be a link to introduction.mdx.

shuding commented 2 years ago

I was thinking about generating "summary" pages for folders automatically if they're missing, but can't think of a good way.

alecpetrosky commented 2 years ago

You can have this structure to make the folder work like a page:

introudction.mdx
introduction/
  a.mdx
  b.mdx

And then in the breadcrumb "Introduction" will be a link to introduction.mdx.

I'm very interested in getting this structure to work but with no success. Creating both introduction.mdx and introduction/ does not show subpages in the left navigation panel. How is possible to achieve to have both navigation folder with sub-items and "index" page to show up when clicking such folder?

dionysuzx commented 1 year ago

I was thinking about generating "summary" pages for folders automatically if they're missing, but can't think of a good way.

would this be something like this? https://docusaurus.io/docs/category/getting-started curious. because i have thought a generated index like this would be very useful.