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

Rename Markdown links when an internal page is moved using yarn content move #8292

Closed
teoli2003 opened this issue Feb 23, 2023 · 1 comment
Closed
Labels
accepting PR We invite you to open a PR to resolve this issue. idle p2 We want to address this but may have other higher priority items. wx writer experience

Comments

@teoli2003
Copy link
Contributor

The problem

Moving pages with yarn content move adds an entry in the redirect files. There is some magic ongoing in Yari to transform this redirect into the correct link when building a page.

Nevertheless, Markdown links inside MDN stay the same. This leads to a few problems:

  • Writers manually edit these links, while this could be automated
  • it is challenging to navigate to the right page in GitHub or in our code editors as the link no longer exists. Usually, we need to open MDN and paste the link to discover the natural slug. That's cumbersome.
  • A flaw is generated when the build process discovers such redirection. This clutters the flaw dashboard and induce manual actions.
  • Reuse of mdn/content is made next to impossible as links are broken (this is not the only offender, but a major one)

Potential solution:

When doing yarn content move (and not yarn content delete), make an extra pass and edit all Markdown links in mdn/content linking to this slug to the new one (preserving the fragment, if any).

This will not solve links created by macros, but we are mostly moving around non-reference pages nowadays, and macros deal with these kinds of links so that it would cover 90% of the cases.

@caugner caugner added p2 We want to address this but may have other higher priority items. accepting PR We invite you to open a PR to resolve this issue. wx writer experience and removed needs-triage labels Feb 23, 2023
@github-actions github-actions bot added the idle label Jan 24, 2024
@caugner
Copy link
Contributor

caugner commented Jun 24, 2024

This was meanwhile implemented in the content repo: mdn/content#31091

@caugner caugner closed this as completed Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepting PR We invite you to open a PR to resolve this issue. idle p2 We want to address this but may have other higher priority items. wx writer experience
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants