-
Notifications
You must be signed in to change notification settings - Fork 18
Description
What information was incorrect, unhelpful, or incomplete?
Summary
If there exists a redirect from document abc
to xyz
in the _redirects.txt
file, and a contributor creates a brand new document abc
, in this case, the yarn content validate-redirects en-US
throws an error saying the redirect resolves to an existing folder. To fix this redirect error if the yarn content fix-redirects
command is used, it doesn't remove the redirect from the _redirects.txt file.
In such cases, we've been asking the contributors to manually remove the redirects.
Steps to reproduce
- In the
mdn/content
repo create a filefiles/en-us/ajax/index.md
- Add the following content to the file
--- title: ajax slug: AJAX page-type: landing-page --- {{GamesSidebar}} Gaming is one of the most popular computer activities. New technologies are constantly arriving to make it possible to develop better and more powerful games that can be run in any standards-compliant web browser.
- Now run
yarn content validate-redirects en-US
Error: Invalid 'from' URL for redirect: From-URL '/en-us/docs/ajax' resolves to an existing folder at 'en-us/ajax/index.md' for locale 'en-US'.
error Command failed with exit code 1. - To fix the redirect error, now run the
yarn content fix-redirects
command. - Notice the command completes without any error. But it doesn't update the _redirects.txt file.
- The error remains unfixed.
What did you expect to see?
The fix-redirects command must remove redirects if the from
document exists. It shouldn't matter if to
document exists or not.
Do you have any supporting links, references, or citations?
Here is a conversation from the Slack channel:
Hamish: If I create a document that is redirected I get a warning. I can fix this by deleting the redirect, but our guidance in contributing.md is never to directly edit the redirects file. Just FMI, is there another way?
Chen: Yes, you need to manually edit
Do you have anything more you want to share?
Should these tool/content commands be documented in the rari
repo or in the content
repo?