EditUrl
doesn't support sub-directories.
#1153
Labels
bug
An error in the Docusaurus core causing instability or issues with its execution
good first issue
If you are just getting started with Docusaurus, this issue should be a good place to begin.
🐛 Bug Report
The edit buttons on the top of pages within sub-directories do not point to the appropriate edit URL on Github. The edit button points to
'editUrl+{fileName}'
. Pages within directories within thedocs/
folder should point to'editUrl+{relativeFilePath}+{fileName}'
.(Also it's worth pointing out that
custom_edit_url
documented here also doesn't work).Have you read the Contributing Guidelines on issues?
Yes.
To Reproduce
docs/
(should have aneditUrl
value set).EDIT
button at the top of the page of a file within a sub-directory ofdocs/
.Expected behavior
The URL should be a concatenation of
editUrl
+ the filepath to the file fromdocs/
+ the filename.Actual Behavior
The URL is a concatenation of
editUrl
and the filename, regardless of directory nesting.E.g a file
../docs/learn/introduction.md
should point to{editUrl}+learn/introduction.md
. Instead it points to{editUrl}+introduction.md
.Reproducible Demo
You can clone our project here and/or replicate by following these steps:
Navigate to Learn/Introduction and press
EDIT
at the top.You are taken to https://github.com/dwstech/muster/edit/develop/packages/website/docs/01-intro-to-muster.md
You should be taken to https://github.com/dwstech/muster/edit/develop/packages/website/docs/learn/01-intro-to-muster.md
For example, most of our documentation for is in sub directories:
The
editUrl
insiteConfig.js
is set but because only the filename is concatenated theEDIT
button only works correctly foroverview.md
.The text was updated successfully, but these errors were encountered: