Skip to content

Sidebar category deep linking #3051

Closed
Closed

Description

@omry

The sidebar of hydra.cc:
image

A link to a doc page looks like : https://hydra.cc/docs/next/advanced/overriding_packages

however, linking to https://hydra.cc/docs/next/advanced/ ends up with an 404.

It would be great to create some surface to somehow show the content of the toolbar instead.

Activity

  1. added
    feature
    status: needs triage
    on Jul 11, 2020
  2. slorber commented on Jul 13, 2020

    @slorber
    Collaborator

    Hi,

    What do you mean by "the content of the toolbar instead". I don't think I see how this should work, and what to display exactly 🤪

    Why do you want to link to a specific sidebar category?

    Do you think we should create a dedicated page for each sidebar category? How would the user discover this feature? (I mean, clicking on a category in the sidebar expands the collapsible, it does not navigate)

  3. omry commented on Jul 13, 2020

    @omry
    Author

    Yes, actually I think that the sidebar category should have a page.

    That page can be auto generated from the sidebar items.
    Extra points if you allow the user to customize it.
    In some cases I actually manually created such a landing page, but I would really prefer that it would be associated with the category itself and not a page in it.

    Example:
    https://hydra.cc/docs/next/tutorials/intro

    Not sure about discoverability, it's a good point.
    However, in many cases I find myself wanting to link to a category and not to the first page in it. an example is a tutorial.

  4. slorber commented on Jul 14, 2020

    @slorber
    Collaborator

    That's an interesting.

    How would you see the api for customizing this page working?

    What do you want on this page by default?
    A flat list of docs?
    Or should it show nested categories?

  5. omry commented on Jul 14, 2020

    @omry
    Author

    Let me start by specifying a few requirements I think exists to make this useful:

    1. The API should allow me to fully specify my own page at minimum (manually, like I am doing in that intro link).
    2. It should allow me to iterate on the sidebar list I am rendering the page for.
    3. For each item in the list, it should provide a convenient way to access the metadata of the page:
    ---
    id: logging
    title: Logging
    sidebar_label: Logging
    ---
    

    Initial API proposal:

    module.exports = {
        Docs: {
            About: [
                'intro',
                'terminology',
            ],
         ...
    

    Let's customize the About category.
    I am going to put down some half-pseudo code, half-copy-page abomination.
    I don't know enough react to make it valid.

    website/src/pages/sidebar/About.jsx

    import Sidebar from '@docusaurus/Sidebar';
    Some user header
    <ul>
      for value in Sidebar.getCategory("About")) {
        <li>{value.name} : {value.title}</li>
      }
    </ul>
    Some user footer
  6. omry commented on Jul 14, 2020

    @omry
    Author

    ideally we would have something better to name the file after than the text in the sidebar, but I don't think sidebar items has an id right now.

    As for your last question:

    I think it should just one level, potentially with navigation that allow movement to the parent or into a sub category.

  7. slorber commented on Jul 20, 2020

    @slorber
    Collaborator

    This issue seems related to #2643

  8. slorber commented on Jul 29, 2020

    @slorber
    Collaborator

    closing as #2643 is enough to track this

  9. added
    closed: duplicate
    and removed
    status: needs triage
    on May 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    closed: duplicatefeature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions