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

Add redirects for docs changes and update formatting #446

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -49,53 +49,75 @@ public function redirects() {

// Any handbook pages where the slug changes should be listed here.
$redirects = [
'components/server-side-render' => 'packages/packages-server-side-render',
'explanations/faq' => 'getting-started/faq',
'explanations/glossary' => 'getting-started/glossary',
'how-to-guides/block-theme' => 'how-to-guides/themes/create-block-theme',
'how-to-guides/block-based-theme' => 'how-to-guides/themes/block-theme-overview',
'components/server-side-render' => 'packages/packages-server-side-render',
'explanations/faq' => 'getting-started/faq',
'explanations/glossary' => 'getting-started/glossary',
'how-to-guides/platform/custom-block-editor/tutorial' => 'how-to-guides/platform/custom-block-editor',
'reference-guides/block-api/versions' => 'reference-guides/block-api/block-api-versions',
'reference-guides/block-api/versions' => 'reference-guides/block-api/block-api-versions',

// After handbook restructuring, December 2023.
'getting-started/create-block/' => 'getting-started/tutorial',
'getting-started/create-block/wp-plugin/' => 'getting-started/tutorial',
'getting-started/create-block/block-anatomy/' => 'getting-started/tutorial',
'getting-started/create-block/attributes/' => 'getting-started/tutorial',
'getting-started/create-block/block-code/' => 'getting-started/tutorial',
'getting-started/create-block/author-experience/' => 'getting-started/tutorial',
'getting-started/create-block/finishing/' => 'getting-started/tutorial',
'getting-started/create-block/submitting-to-block-directory/' => 'getting-started/tutorial',
'how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/' => 'getting-started/fundamentals/block-json',
'how-to-guides/block-tutorial/block-supports-in-static-blocks/' => 'getting-started/fundamentals/block-json',
'how-to-guides/block-tutorial/block-supports-in-dynamic-blocks/' => 'getting-started/fundamentals/block-json',
'how-to-guides/javascript' => 'getting-started/fundamentals/javascript-in-the-block-editor',
'how-to-guides/javascript/plugins-background/' => 'getting-started/fundamentals/javascript-in-the-block-editor',
'how-to-guides/javascript/loading-javascript/' => 'getting-started/fundamentals/javascript-in-the-block-editor',
'how-to-guides/javascript/extending-the-block-editor/' => 'getting-started/fundamentals/javascript-in-the-block-editor',
'how-to-guides/javascript/troubleshooting/' => 'getting-started/fundamentals/javascript-in-the-block-editor',
'how-to-guides/javascript/versions-and-building/' => 'getting-started/fundamentals/javascript-in-the-block-editor',
'how-to-guides/javascript/scope-your-code/' => 'getting-started/fundamentals/javascript-in-the-block-editor',
'how-to-guides/javascript/js-build-setup/' => 'getting-started/fundamentals/javascript-in-the-block-editor',
'how-to-guides/javascript/esnext-js/' => 'getting-started/fundamentals/javascript-in-the-block-editor',

// After handbook restructuring, March 2021.
'handbook/versions-in-wordpress/' => 'contributors/versions-in-wordpress',
'architecture/fse-templates' => 'explanations/architecture/full-site-editing-templates',
'architecture/fse-templates' => 'explanations/architecture/full-site-editing-templates',
'developers/internationalization' => 'how-to-guides/internationalization',
'developers/richtext' => 'reference-guides/richtext',
'developers/accessibility' => 'how-to-guides/accessibility',
'developers/feature-flags' => 'how-to-guides/feature-flags',
'tutorials/devenv' => 'getting-started/devenv',
'tutorials/devenv/docker-ubuntu' => 'getting-started/devenv/docker-ubuntu',
'tutorials/block-based-theme' => 'how-to-guides/themes/block-theme-overview',
'developers/richtext' => 'reference-guides/richtext',
'developers/accessibility' => 'how-to-guides/accessibility',
'developers/feature-flags' => 'how-to-guides/feature-flags',
'tutorials/devenv' => 'getting-started/devenv',
'tutorials/devenv/docker-ubuntu' => 'getting-started/devenv/docker-ubuntu',
'tutorials/block-based-theme' => 'how-to-guides/themes/block-theme-overview',
];

// General path redirects. (More specific path first.)
$path_redirects = [
// 'some-path/' => 'new-path/',

// After handbook restructuring, March 2021.
'architecture/' => 'explanations/architecture/',
'contributors/develop/' => 'contributors/code/',
'contributors/document/' => 'contributors/documentation/',
'data/' => 'reference-guides/data/',
'designers/' => 'how-to-guides/designers/',
'architecture/' => 'explanations/architecture/',
'contributors/develop/' => 'contributors/code/',
'contributors/document/' => 'contributors/documentation/',
'data/' => 'reference-guides/data/',
'designers/' => 'how-to-guides/designers/',
'developers/backward-compatibility/' => 'how-to-guides/backward-compatibility/',
'developers/block-api/' => 'reference-guides/block-api/',
'developers/filters/' => 'reference-guides/filters/',
'developers/platform/' => 'how-to-guides/platform/',
'developers/slotfills/' => 'reference-guides/slotfills/',
'developers/themes/' => 'how-to-guides/themes/',
'handbook/tutorials/' => 'getting-started/',
'packages/' => 'reference-guides/packages/',
'tutorials/create-block/' => 'getting-started/create-block/',
'tutorials/plugin-sidebar-0/' => 'how-to-guides/sidebar-tutorial/',
'tutorials/' => 'how-to-guides/',
'developers/block-api/' => 'reference-guides/block-api/',
'developers/filters/' => 'reference-guides/filters/',
'developers/platform/' => 'how-to-guides/platform/',
'developers/slotfills/' => 'reference-guides/slotfills/',
'developers/themes/' => 'how-to-guides/themes/',
'handbook/tutorials/' => 'getting-started/',
'packages/' => 'reference-guides/packages/',
'tutorials/create-block/' => 'getting-started/create-block/',
'tutorials/plugin-sidebar-0/' => 'how-to-guides/sidebar-tutorial/',
'tutorials/' => 'how-to-guides/',
];

// Redirects away from the block editor handbook.
$handbook_redirects = [
// 'some-block-editor-path' => '/new-path-relative-to-developer-root/',
'how-to-guides/themes/block-theme-overview' => '/themes/block-themes/',
'how-to-guides/block-based-theme' => '/themes/block-themes/',
'how-to-guides/block-theme' => '/themes/block-themes/',
];

$new_handbook_path = '';
Expand Down