[docs] Rename duplicate manifest slugs breaking developer.wordpress.org pages - #4266
Draft
mho22 wants to merge 2 commits into
Draft
[docs] Rename duplicate manifest slugs breaking developer.wordpress.org pages#4266mho22 wants to merge 2 commits into
mho22 wants to merge 2 commits into
Conversation
The developer.wordpress.org handbook importer matches pages by bare slug. The Xdebug page and the Blueprints getting-started page both used the slug getting-started, so the import converted the Blueprints page into the Xdebug page and broke /playground/blueprints/getting-started/. Rename the Xdebug slug and redirect the old path. Fixes #4264.
Same slug collision as the Xdebug getting-started page: the handbook page and the Blueprint steps reference both used the slug resources, so /playground/resources/ redirects to /playground/blueprints/steps/resources/ on developer.wordpress.org. Rename the handbook page slug back to links-and-resources and redirect the old path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation for the change, related issues
Fixes #4264.
The developer.wordpress.org handbook importer matches pages by bare slug, not by path (the
slug_onlymap inwporg-markdown/inc/class-importer.php).manifest.jsonhad two entries with the sluggetting-started: the Blueprints index and the Xdebug quick start. When the Xdebug docs were imported, the importer matched the existing Blueprints post by slug and converted it into the Xdebug page, so/playground/blueprints/getting-started/now 404-redirects to/playground/developers/xdebug/getting-started/.The slug
resourceshas the same collision:/playground/resources/(Links and Resources) currently redirects to/playground/blueprints/steps/resources/(the Blueprint steps reference), and the two "Links and resources" links on the handbook landing page land on the wrong page.Implementation details
One commit per renamed page. In each pair the older, more heavily linked URL keeps its slug.
/developers/xdebug/getting-started→/developers/xdebug/xdebug-getting-started: frontmatter,manifest.json, two links in the Xdebug introduction, a client-side redirect inredirections.js, and the es/fr/pt-BR i18n copies./resources→/links-and-resources: frontmatter,manifest.json, links inintro.md, the Blueprints tutorial andtranslations.md, a flipped redirect inredirections.js(the page originally lived at/links-and-resources), and all i18n copies. Translated frontmatter overrides the original slug, so the i18n updates are required for the locale builds to pass.No manual action is needed on developer.wordpress.org: on the next import run the Blueprints manifest entry re-claims the hijacked post by slug and
update_post_from_manifestrestores its parent and title; the two renamed pages are created as new posts.Breaking change: two documentation URLs move —
/developers/xdebug/getting-startedand/resources. Old links to them redirect on the Docusaurus site; on developer.wordpress.org old links to the Xdebug quick start will land on the restored Blueprints page until updated.Testing Instructions (or ideally a Blueprint)
npx nx build docs-site— builds all locales;dist/docs/buildcontains real pages at the new paths and redirect pages at the old ones, and/blueprints/getting-started/still exists.npx nx check-orphan-pages docs-site— passes.curl -sI https://developer.wordpress.org/playground/blueprints/getting-started/returns a 301 to the Xdebug page.