Setting id
frontmatter unexpectedly affects the published path of a document
#10496
Open
2 tasks done
Labels
documentation
The issue is related to the documentation of Docusaurus
Have you read the Contributing Guidelines on issues?
Description
We recently discovered that setting
id
in the frontmatter has the same effect as settingslug
, specifically it will set the path of the document to/{id}
instead of/{filename}
.The documentation describes this value as "A unique document ID.", and does not mention this important side effect.
I was able to track this down to https://github.com/facebook/docusaurus/blob/main/packages/docusaurus-plugin-content-docs/src/docs.ts#L143, but I am still unclear about the intent of reading
frontMatter.id
here and using it instead ofunprefixedFilename
if it exists.So, I am not sure if this is a bug, or a documentation issue. I think if there's already a way to override using the filename as the path (by setting
slug
frontmatter), settingid
should not also change it. If this is intentional for whatever reason, we should update the documentation to mention that setting this will also change the path.Self-service
The text was updated successfully, but these errors were encountered: