Skip to content

Add "redirect" link type #8833

Closed as not planned
Closed as not planned

Description

@bfelbo

Have you read the Contributing Guidelines on issues?

Description

It would be great to allow clicking on the sidebar category to redirect the viewer to a subpage inside that category (most likely an "Intro" page).

Has this been requested on Canny?

https://docusaurus.canny.io/feature-requests/p/add-redirect-link-type

Motivation

The closest thing to this is the doc link type (see #2643). However, the doc link type doesn't redirect, but puts that content into the sidebar category page. This is non-ideal because viewers might miss that clicking on a category has important information. Especially if they're opening a category subpage from an external link.

API design

This could be done by adding a redirect link type following a similar API to the doc link type.

Have you tried building it?

I've asked in the Docusaur Discord and was told by a moderator that it's a bit tricky to do and would have to be done in an inelegant way. I was suggested to post a feature request about this.

Self-service

  • I'd be willing to contribute this feature to Docusaurus myself.

(I don't know enough about Docusaurus to understand how to contribute it in the best way)

Activity

  1. added
    feature
    status: needs triage
    on Mar 27, 2023
  2. slorber commented on Apr 6, 2023

    @slorber
    Collaborator

    However, the doc link type doesn't redirect, but puts that content into the sidebar category page.

    I have no idea what you mean by "redirect" or "puts that content into the sidebar category page"

    The category is a link, or is not. We don't hit the server when clicking it so the concept of redirect does not make sense to me.


    Consider the following structure:

    module.exports = {
      docs: [
        {
          type: 'category',
          label: 'Guides',
          link: {type: 'doc', id: 'introduction'},
          items: ['introduction',  /* other items */],
        },
      ],
    };
    

    Clicking on the "Guides" category will navigate to the intro doc (and not "redirect" to it)

    The Intro doc will also appear as a child of the category

    So you access the same doc from 2 links:

    • the Guides category item link
    • the Guides/Introduction item link

    If this is not what you want, please do some mockups and provide examples using real links and sidebar configs to illustrate (ie not just text).

  3. removed
    status: needs triage
    on Apr 6, 2023
  4. added
    status: needs more information
    on Apr 6, 2023
  5. nishitiwari22 commented on Sep 29, 2023

    @nishitiwari22

    Is this issue open? I am looking to contribute to it.

  6. Josh-Cena commented on Sep 30, 2023

    @Josh-Cena
    Collaborator

    Closing because we got no feedback

  7. removed
    status: needs more information
    on Sep 30, 2023
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

    feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions