Skip to content

Improve docs navbar items error messages #8696

@slorber

Description

@slorber

Have you read the Contributing Guidelines on issues?

Motivation

The navbar error messages are not so great and some new users get confused when they encounter an error trying to modify a newly initialized Docusaurus project.

I think we should improve these error messages so that users understand what to do:

image

cf #8692

Also we could introduce a new docSidebar navbar item that links to a given sidebar. This is less likely to lead users to encounter errors when trying Docusaurus for the first time because they are less likely to delete/rename a sidebar IMHO.

The init template has an tutorialSidebar autogenerated sidebar: https://github.com/facebook/docusaurus/blob/main/examples/classic/sidebars.js

I suggest moving the init template from:

navbar: {
        items: [
          {
            type: 'doc',
            docId: 'intro',
            position: 'left',
            label: 'Tutorial',
          },
        ],
      },

to

navbar: {
        items: [
          {
            type: 'docSidebar',
            sidebarName: 'tutorialSidebar',
            position: 'left',
            label: 'Tutorial',
          },
        ],
      },

Good first issue for an external contributor that feels comfortable taking this task.

You can claim the issue here, but please submit a first draft PR within 24h.
Otherwise, someone else can claim it again and submit a new PR.

Self-service

  • I'd be willing to do some initial work on this proposal myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueIf you are just getting started with Docusaurus, this issue should be a good place to begin.proposalThis issue is a proposal, usually non-trivial change

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions