-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Closed
Labels
closed: duplicateThis issue or pull request already exists in another issue or pull requestThis issue or pull request already exists in another issue or pull requestfeatureThis is not a bug or issue with Docusausus, per se. It is a feature request for the future.This is not a bug or issue with Docusausus, per se. It is a feature request for the future.
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
Prerequisites
- I'm using the latest version of Docusaurus.
- I have tried the
npm run clearoryarn clearcommand. - I have tried
rm -rf node_modules yarn.lock package-lock.jsonand re-installing packages. - I have tried creating a repro with https://new.docusaurus.io.
- I have read the console error message carefully (if applicable).
Description
When you use a link of type 'doc' in a 'category' sidebar item, which is the default document when you click on that category, it does not hide the linked document inside that category.
tutorialSidebar: [
'intro',
{
type: 'category',
label: 'Tutorial Basics',
link: {type: 'doc', id: 'tutorial-basics/create-a-page'},
items: [{type: 'autogenerated', dirName: 'tutorial-basics'}],
},
],
If you use autogenerated directory structure though, and set up such a default link inside the _category.json, then it does hide the default document under that category.
{
"label": "Tutorial - Basics",
"position": 2,
"link": { "type": "doc", "id": "create-a-page" }
}Steps to reproduce
- Create a new website using
npx create-docusaurus@latest website classic - Update
sidebars.jsto use the following sidebar
tutorialSidebar: [
'intro',
{
type: 'category',
label: 'Tutorial Basics',
link: {type: 'doc', id: 'tutorial-basics/create-a-page'},
items: [{type: 'autogenerated', dirName: 'tutorial-basics'}],
},
],
- Launch the website using
yarn start. - Navigate to Tutorial nav menu.
Expected behavior
The Create a Page item should be hidden under the Tutorial Basic category.
Actual behavior
The Create a Page item is visible under the Tutorial Basic category.
Your environment
- Public source code:
- Public site URL: https://xomega.net/docs
- Docusaurus version used: 2.0.0-beta.13
- Environment name and version (e.g. Chrome 89, Node.js 16.4):
- Operating system and version (e.g. Ubuntu 20.04.2 LTS):
Reproducible demo
No response
Self-service
- I'd be willing to fix this bug myself.
robbieaverill
Metadata
Metadata
Assignees
Labels
closed: duplicateThis issue or pull request already exists in another issue or pull requestThis issue or pull request already exists in another issue or pull requestfeatureThis is not a bug or issue with Docusausus, per se. It is a feature request for the future.This is not a bug or issue with Docusausus, per se. It is a feature request for the future.