shuding / nextra

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

[v3] applying `display: "hidden"` breaks _meta in the subdir #2909

Open hezean opened 4 months ago

hezean commented 4 months ago

When using nextra and the docs theme of version 3.0.0-alpha.24, setting the display mode of a subdir to "hidden" seems to make the _meta file in that folder not work.

Say I set all pages in the sample dir to be with the article typesetting, as shown like:

Screenshot 2024-05-30 at 02 03 48

After setting the _meta file of its parent dir to:

export default {
  sample: {
    display: "hidden",
  }
}

the page comes like:

Screenshot 2024-05-30 at 02 04 09

Here's the code for a minimal reproducible example: nextra3-meta-not-applied.zip

marcklingen commented 5 days ago

Same applies to us. This route is hidden but linked to via our custom switcher on top of the sidebar. The sidebar is not rendered at all as the parent meta hides this page.

https://langfuse.com/guides

Edit: Fixed this for us via css override (desktop menu only)

Global overrides.css (source)

/* Hide guides and faq from main menu */
.nextra-nav-container>nav>a[href="/guides"] {
    display: none;
}

_meta.tsx


export default {
  ...
  guides: {
    type: "page",
    title: "Guides",
  },
  ...
}