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

EditUrl doesn't support sub-directories. #1153

Closed
dws-sam opened this issue Dec 10, 2018 · 0 comments · Fixed by #1154
Closed

EditUrl doesn't support sub-directories. #1153

dws-sam opened this issue Dec 10, 2018 · 0 comments · Fixed by #1154
Assignees
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.

Comments

@dws-sam
Copy link

dws-sam commented Dec 10, 2018

🐛 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 the docs/ 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

  1. Get any Docusaurus project with pages in sub-directories of docs/ (should have an editUrl value set).
  2. Press the EDIT button at the top of the page of a file within a sub-directory of docs/.
  3. Check to see if the tail of the URL includes the sub-directory path or just has the filename.

Expected behavior

The URL should be a concatenation of editUrl + the filepath to the file from docs/ + 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:

git clone https://github.com/dwstech/muster.git
cd muster/packages/website/
yarn
yarn run start

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:

Docs
├── overview.md
├── learn
│   ├── 01-intro-to-muster.md
│   ├── 02-graph-data-structure.md
...
├── resources
│   ├── 01-setup.md
│   ├── 03-faq.md
...

The editUrl in siteConfig.js is set but because only the filename is concatenated the EDIT button only works correctly for overview.md.

@endiliey endiliey added 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. labels Dec 10, 2018
@endiliey endiliey self-assigned this Dec 10, 2018
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 good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants