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

Can't create "subdoc" from content dir's root #3996

Open
SukkaW opened this issue Jan 22, 2025 · 1 comment
Open

Can't create "subdoc" from content dir's root #3996

SukkaW opened this issue Jan 22, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@SukkaW
Copy link
Contributor

SukkaW commented Jan 22, 2025

Describe the bug

Given the given folder structure:

src
  content
    index.mdx
    getting-started
      index.mdx
      a.mdx
    tips
      index.mdx
      a.mdx
  changelogs
    1.0.0.mdx
    1.0.1.mdx
    2.0.0.mdx
  api
    index.mdx
    a.mdx
    b.mdx
// _meta.global.ts
export default {
  index: {
    title: 'Homepage',
    items: {
      'getting-started': {},
      tips: {
        items: {}
      }
    }
  },
  changelog: {
    type: 'page',
    title: 'Changelog',
    items: {}
  },
  api: {
    type: 'page',
    title: 'API',
    items: {}
  }
}

I want to create three subdocs:

  • Guide
    • index
    • getting-started folder
    • tips folder
  • Changelog
    • changelogs folder
  • API
    • api folder

To Reproduce

  • Navigate to the Changelog in the navbar
  • Seeing the getting-started and tips folders show up in the Changelog's sidebar
Image

Expected behavior

What I want to achieve is that the "Changelog" subdoc should only contain its own items, without getting-started and tips.

Screenshots

The sidebar of "Guide" subdoc:

Image

The sidebar of "Changelog" subdoc:

Image

Additional context

The PM doesn't want to have a dedicated homepage and wants to see the Guide subdoc immediately when visiting the docs root, so I have to create a subdoc from the root of content.

@SukkaW SukkaW added the bug Something isn't working label Jan 22, 2025
@SukkaW SukkaW changed the title Can't use content dir's root as a "subdoc" Can't create "subdoc" from content dir's root Jan 22, 2025
@dimaMachina
Copy link
Collaborator

Hi, currently it isn't supported in nextra, I think something similar I saw in docusaurus (it was named category?)

Seeing the getting-started and tips folders show up in the Changelog's sidebar

it is because at this moment if you want to have this structure

  • Guide
    • index
    • getting-started folder
    • tips folder

everything should be inside guide or something directory, and guide should have type: 'page'

guide/index
guide/getting-started/
guide/tips/

PR is welcome to improve it, happy to help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants