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

[RESEARCH] Sidenav behavior when a page is in multiple places #28

Open
1 task done
melissahenderson opened this issue Nov 22, 2024 · 2 comments
Open
1 task done
Assignees
Labels
enhancement New feature or request

Comments

@melissahenderson
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

What type of enhancement are you suggesting?

Brand new component

Is your feature request related to a problem? Please describe.

I labeled this issue as RESEARCH because I don't know if what I want is possible. If it is, we'd need to see if the effort is worth it.

If a page is listed multiple places within the sidebar section of astro.config.mjs, clicking the page in the sidenav in one area will expand any other area the page is placed in. For example, if I put the Accounting page in the Concepts section and the Resources section, clicking the link to the page in Concepts will cause the Resources section to expand (and vice versa).

Screenshot 2024-11-22 at 7 57 37 AM

Describe the solution you'd like

Ideally, I'd like this not to happen. If I click the Accounting page in Concepts, the Resources section remains collapsed.

Describe alternatives you've considered

One alternative I've considered is making a partial out of the page I want to appear in multiple sections. It would look something like this:

src/content/partials

  • accounting.mdx (file with all the content)

src/content/docs/overview/concepts

  • accounting-concepts.mdx (with accounting.mdx partial embedded within)

src/content/docs/resources

  • accounting-resources.mdx (with accounting.mdx partial embedded within)

astro.config.mjs

  • Entry in Overview > Concepts section referencing accounting-concepts.mdx
  • Entry in Resources section referencing accounting-resources.mdx

I don't like this approach primarily because it now takes three files (in this example) to do the work of one file. It's also not a good practice to use partial files for entire pages of content. However, it IS a feasible workaround.

Additional context

Questions:

  • Is there a better solution?
  • If yes, is it worth the effort to implement?
@JoblersTune
Copy link
Contributor

@melissahenderson The first thing I'd like to understand is why we need a page to appear in two different locations in the menu. Can we chat about that?

@melissahenderson
Copy link
Author

@JoblersTune Let me get a few examples, then i'll follow up with you.

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
Status: Backlog
Development

No branches or pull requests

2 participants