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

Single file with same name as folder is stripped from sidebar (Category index) - since 2.0.0-beta.19 #7446

Closed
3 of 7 tasks
ambroiseRabier opened this issue May 18, 2022 · 2 comments
Labels
bug An error in the Docusaurus core causing instability or issues with its execution closed: duplicate This issue or pull request already exists in another issue or pull request

Comments

@ambroiseRabier
Copy link

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and 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

Since 2.0.0-beta.19, a folder docs/Same with a single file docs/Same/Same.md is not shown in sidebar. It work in 2.0.0-beta.18 as documented here.

Observe Same folder being absent from the sidebar:

image

image

Reproducible demo

https://stackblitz.com/edit/github-vnuu5v?file=docs/Same/Same.md

Steps to reproduce

  1. Create a folder docs/Same.
  2. Create a file docs/Same/Same.md
  3. Observe the sidebar not displaying "Same" link item.

Expected behavior

With a folder docs/Same containing a single file docs/Same/Same.md, the expected output as per https://docusaurus.io/docs/sidebar/autogenerated#category-index-convention would be to have the Sidebar display docs/Same as a link, linking to docs/Same/Same.md.

Actual behavior

A folder docs/Same with a single file docs/Same/Same.md is not shown in sidebar.

Note that if you rename the file to docs/Same/Different.md, or if add another file to docs/Same folder, it work as expected.

Your environment

Self-service

  • I'd be willing to fix this bug myself.
@ambroiseRabier ambroiseRabier added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels May 18, 2022
@Josh-Cena Josh-Cena added closed: duplicate This issue or pull request already exists in another issue or pull request and removed status: needs triage This issue has not been triaged by maintainers labels May 18, 2022
@Josh-Cena
Copy link
Collaborator

Duplicate of #7348

@Josh-Cena Josh-Cena marked this as a duplicate of #7348 May 18, 2022
@Josh-Cena
Copy link
Collaborator

You can try using the canary version

@Josh-Cena Josh-Cena closed this as not planned Won't fix, can't repro, duplicate, stale May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution closed: duplicate This issue or pull request already exists in another issue or pull request
Projects
None yet
Development

No branches or pull requests

2 participants