fix(docs): add custom editUrl path for intro page #31334
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SUMMARY
Problem
At issue is a broken link on the main docs intro page (https://superset.apache.org/docs/intro). This bug was introduced after a previous PR: docs: various improvements across the docs, which removed the intro.md file from the superset/docs/docs subdirectory after deeming it redundant. This change had the unintended consequence of breaking the link for the "Edit this page on GitHub" button on the main docs/intro site page. This is because the docusaurus.config.js is currently configured to return a path of 'https://github.com/apache/superset/edit/master/docs/' + docPath. While this works fine for the other sidebar items that are still housed in the docs/docs subdirectory, it needs updating for the intro page, which is currently built from the main repo README.md file.
Solution
Add a custom editURL function to the docusaurus.config.js file so that the intro page will now properly redirect to the main repo README.md file, and the remaining sidebar links will remain unchanged.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Link Location:

Before:

After:

TESTING INSTRUCTIONS
Change the docusaurus.config.js file as suggested and check that the intro page link is working correctly. Verify that all other page links continue working as expected.
ADDITIONAL INFORMATION