You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Docs plugin - possible conflict between docs files with similar names #11136
Hello, currently the framework is functioning smoothly. However, we've encountered an issue. Once a Markdown document starts with a number, a default URL is generated. For example, if the document names are "8 - aaa - test" and "6 - aaa - hello", there are also differences in the slug within the document. After previewing, the system will recognize them as one document. Has anyone encountered a similar problem and know how to solve it?
Self-service
I'd be willing to address this documentation request myself.
Thank you very much for your prompt reply. If this issue is fixed or you have any solutions, please let me know again. Since the local files I have were set up a year ago and may not be the latest version, it will be convenient for me to update my local files. Thank you again.
changed the title [-]Regarding the command - style issues of Markdown documents.[/-][+]Docs plugin - possible conflict between docs files with similar names[/+]on May 15, 2025
The number prefix is not taken into consideration when computing the document id from its file system location.
To prevent such unexpected conflicts, I will add an error message when this happens and recommend that users provide an explicitly distinct front matter ID.
Really curious though: what's the reason you want to use the same name for both files, and only change the number prefix? Do you have a good use case for this?
Really curious though: what's the reason you want to use the same name for both files, and only change the number prefix? Do you have a good use case for this?
We can imagine a scenario like this: suppose there are two screen products of different sizes, such as a 4-inch screen and a 5-inch screen. When writing documentation, if the files are named 4-inch-display.md and 5-inch-display.md respectively, the generated IDs would be duplicated.
Activity
slorber commentedon May 2, 2025
Please create a https://docusaurus.new runnable repro using our bug report template.
xt8288 commentedon May 6, 2025
https://stackblitz.com/edit/github-hju2cjvr?file=docs%2Ftutorial-basics%2F7-aaa-display.md
slorber commentedon May 6, 2025
Thanks, I confirm something weird is happening
xt8288 commentedon May 6, 2025
Thank you very much for your prompt reply. If this issue is fixed or you have any solutions, please let me know again. Since the local files I have were set up a year ago and may not be the latest version, it will be convenient for me to update my local files. Thank you again.
[-]Regarding the command - style issues of Markdown documents.[/-][+]Docs plugin - possible conflict between docs files with similar names[/+]slorber commentedon Jun 2, 2025
So, the problem is that both documents within the same directory gets assigned the same id
The logic looks like this:
The number prefix is not taken into consideration when computing the document id from its file system location.
To prevent such unexpected conflicts, I will add an error message when this happens and recommend that users provide an explicitly distinct front matter ID.
Really curious though: what's the reason you want to use the same name for both files, and only change the number prefix? Do you have a good use case for this?
eMUQI commentedon Feb 11, 2026
@slorber
We can imagine a scenario like this: suppose there are two screen products of different sizes, such as a 4-inch screen and a 5-inch screen. When writing documentation, if the files are named
4-inch-display.mdand5-inch-display.mdrespectively, the generated IDs would be duplicated.slorber commentedon Feb 12, 2026
I see thanks
In this case, the intention is not to use the "number prefix" as a way to order the sidebar, because the name of the doc contains that number.
In that case, maybe it's better to use
display-4-inch.md, orfour-inch-display.mdWe also have options to opt out / customize the parsing of number prefixes on a case-by-case basis: