-
-
Notifications
You must be signed in to change notification settings - Fork 125
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
fix: dynamic editUrl
path for documentation subfolder structure
#247
fix: dynamic editUrl
path for documentation subfolder structure
#247
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Compliance Checks Passed!
✅ Deploy Preview for learn-opensauced ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
editUrl
path for documentation subfolder structureeditUrl
path for documentation subfolder structure
editUrl
path for documentation subfolder structureeditUrl
path for documentation subfolder structure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @Codexnever,
Thank you for your PR! ✨
I've tested this out locally, and it works well. 👍🏼
As @BekahHW mentioned:
You can create the PR if it's working locally.
let's stick to that.
I see that you made some other changes here that are not required in the issue. Is there any reason for making these changes?
@BekahHW, I just have some thoughts here after taking a closer look, and would love your feedback. When folks click the "Edit this page" link, they will be redirected to the page where they can edit their changes directly on the Some docs have this link on their website. However, most of them redirect folks to a page asking contributors to fork the repo to make changes. Let's take Algolia DocSearch as an example. The link redirects to this page (see the screenshot below). I think we can adapt this method for this intro repo to encourage folks to improve our website while preventing any direct changes. |
I think once the user completes the changes, this is what they should see bc it's a protected branch. So this shouldn't be a problem: ![]() |
Hi @BekahHW , After reflecting on @adiati98 comments, I think we can improve the "Edit this page" functionality. Here’s my proposal:
This way, we ensure that edits are made in the appropriate context while helping new contributors understand the process better. What are your thoughts on this approach? |
@Codexnever I think it should automatically tell contributors that if we have the permissions set up properly. For example, when I try to edit a repo I don't have permission to directly in GH, this is what comes up: ![]() Can you try to edit the Readme or one of the files in this project directly to see what happens? |
Hey @BekahHW, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @Codexnever,
You haven't revert the changes in the package-lock.json
. Can you please revert to the original state? Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done and thank you for your contribution, @Codexnever! ✨🚢
If you haven't, you can join our Community. 🍕
Description:
This pull request addresses an issue with the
editUrl
configuration in thedocusaurus.config.js
file, where theeditUrl
was incorrectly concatenating the paths for editing the documentation. The issue was observed when the documentation structure was split into multiple subfolders, but the correct path was not reflected in the edit links.Problem:
When attempting to edit documentation from the site, the generated edit URL was appending paths incorrectly. For example, it was redirecting users to:
This resulted in a broken link because of the duplicate path segments.
Solution:
Dynamic Path Handling: Updated the
editUrl
on line 47 of thedocusaurus.config.js
file to handle the subfolder structure dynamically. TheeditUrl
now accurately reflects the path by properly concatenating the correct segments of the URL.Folder Structure: The course documentation was split into two subfolders, which wasn't properly handled in the
editUrl
path. The issue has now been resolved by making theeditUrl
match the actual structure of the docs subfolder.Changes Made:
editUrl
on line 47 of thedocusaurus.config.js
to dynamically handle the subfolder structure.main
branch of the GitHub repository for the documentation:Verification:
Affected Files:
docusaurus.config.js
: Corrected theeditUrl
configuration to prevent path duplication and broken links.Related Issues:
Close #241