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

Docs: Links redirections #1758

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/docs/site/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const path = require('path');
const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
const typedoc = require('../../../typedoc.js');
const redirections = require('./redirections.js');

/** @type {import('@docusaurus/types').Config} */
const config = {
Expand Down Expand Up @@ -54,6 +55,7 @@ const config = {
to: '/',
from: '/docs/start-here',
},
...redirections,
],
createRedirects(existingPath) {
if (!existingPath.startsWith('/docs')) {
Expand Down Expand Up @@ -198,7 +200,7 @@ const config = {
},
}),
};

console.log(JSON.stringify(config, null, 2));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@juanmaguitar I take it this is intentional to log the entire config?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, that shouldn't be there. I just comitted the removal of that line.
Thanks for the heads up!

module.exports = config;

/**
Expand Down
154 changes: 154 additions & 0 deletions packages/docs/site/redirections.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
const redirections = [
{ to: '/developers/apis/', from: '/apis-overview' },
{
to: '/developers/architecture/browser-concepts',
from: '/architecture/browser-concepts',
},
{
to: '/developers/architecture/browser-cross-process-communication',
from: '/architecture/browser-cross-process-communication',
},
{
to: '/developers/architecture/browser-iframe-rendering',
from: '/architecture/browser-iframe-rendering',
},
{
to: '/developers/architecture/browser-php-worker-threads',
from: '/architecture/browser-php-worker-threads',
},
{
to: '/developers/architecture/browser-scopes',
from: '/architecture/browser-scopes',
},
{
to: '/developers/architecture/browser-service-workers',
from: '/architecture/browser-service-workers',
},
{
to: '/developers/architecture/browser-tab-orchestrates-execution',
from: '/architecture/browser-tab-orchestrates-execution',
},
{
to: '/developers/architecture/browser-wordpress',
from: '/architecture/browser-wordpress',
},
{
to: '/developers/architecture/host-your-own-playground',
from: '/architecture/host-your-own-playground',
},
{ to: '/developers/architecture/index', from: '/architecture/index' },
{ to: '/blueprints', from: '/blueprints-api/index' },
{ to: '/contributing', from: '/contributing/index' },
{ to: '/developers/apis/javascript-api', from: '/javascript-api/index' },
{
to: '/developers/architecture/wasm-asyncify',
from: '/architecture/wasm-asyncify',
},
{
to: '/developers/architecture/wasm-php-compiling',
from: '/architecture/wasm-php-compiling',
},
{
to: '/developers/architecture/wasm-php-data-dependencies',
from: '/architecture/wasm-php-data-dependencies',
},
{
to: '/developers/architecture/wasm-php-filesystem',
from: '/architecture/wasm-php-filesystem',
},
{
to: '/developers/architecture/wasm-php-javascript-module',
from: '/architecture/wasm-php-javascript-module',
},
{
to: '/developers/architecture/wasm-php-overview',
from: '/architecture/wasm-php-overview',
},
{
to: '/developers/architecture/wordpress',
from: '/architecture/wordpress',
},
{
to: '/developers/architecture/wordpress-database',
from: '/architecture/wordpress-database',
},
{ to: '/blueprints/tutorial/', from: '/blueprints-api/blueprint-101/' },
{
to: '/blueprints/tutorial/build-your-first-blueprint',
from: '/blueprints-api/blueprint-101/build-your-first-blueprint',
},
{
to: '/blueprints/tutorial/how-to-load-run-blueprints',
from: '/blueprints-api/blueprint-101/how-to-load-run-blueprints',
},
{
to: '/blueprints/troubleshoot-and-debug-blueprints',
from: '/blueprints-api/blueprint-101/troubleshoot-debug-blueprints',
},
{
to: '/blueprints/tutorial/what-are-blueprints-what-you-can-do-with-them',
from: '/blueprints-api/blueprint-101/what-are-blueprints-what-you-can-do-with-them',
},
{ to: '/blueprints/data-format', from: '/blueprints-api/data-format' },
{ to: '/blueprints/examples', from: '/blueprints-api/examples' },
{
to: '/blueprints/steps/api-consistency',
from: '/blueprints-api/json-api-and-function-api',
},
{ to: '/blueprints/steps/resources', from: '/blueprints-api/resources' },
{ to: '/blueprints/steps', from: '/blueprints-api/steps' },
{
to: '/blueprints/steps/shorthands',
from: '/blueprints-api/steps-shorthands',
},
{
to: '/blueprints/troubleshoot-and-debug-blueprints',
from: '/blueprints-api/troubleshoot-and-debug-blueprints',
},
{
to: '/blueprints/using-blueprints',
from: '/blueprints-api/using-blueprints',
},
{ to: '/developers/build-your-first-app', from: '/build-your-first-app' },
{
to: '/developers/apis/javascript-api/blueprint-functions-in-api-client',
from: '/javascript-api/blueprint-functions-in-api-client',
},
{
to: '/developers/apis/javascript-api/blueprint-json-in-api-client',
from: '/javascript-api/blueprint-json-in-api-client',
},
{
to: '/developers/apis/javascript-api/-html-vs-remote-html',
from: '/javascript-api/index-html-vs-remote-html',
},
{
to: '/developers/apis/javascript-api/mount-data',
from: '/javascript-api/mount-data',
},
{
to: '/developers/apis/javascript-api/playground-api-client',
from: '/javascript-api/playground-api-client',
},
{ to: '/developers/limitations', from: '/limitations' },
{ to: '/resources', from: '/links-and-resources' },
{
to: '/developers/local-development/php-wasm-node',
from: '/local-development/php-wasm-node',
},
{
to: '/developers/local-development/vscode-extension',
from: '/local-development/vscode-extension',
},
{
to: '/developers/local-development/wp-now',
from: '/local-development/wp-now',
},
{ to: '/about', from: '/overview' },
{ to: '/developers/apis/', from: '/playground-apis/api-concepts' },
{ to: '/developers/apis/query-api', from: '/query-api' },
{ to: '/quick-start-guide', from: '/start-using' },
{ to: '/contributing/contributor-day', from: '/wordcamp-contributor-day' },
];

module.exports = redirections;
Loading