From 8bb7a08524fabbcb64c1516ff772d8ff73875d7f Mon Sep 17 00:00:00 2001 From: JuanMa Garrido Date: Thu, 12 Sep 2024 18:49:30 +0200 Subject: [PATCH 1/2] redirections --- packages/docs/site/docusaurus.config.js | 4 +- packages/docs/site/redirections.js | 154 ++++++++++++++++++++++++ 2 files changed, 157 insertions(+), 1 deletion(-) create mode 100644 packages/docs/site/redirections.js diff --git a/packages/docs/site/docusaurus.config.js b/packages/docs/site/docusaurus.config.js index 3e48f82dc7..e5b2414f01 100644 --- a/packages/docs/site/docusaurus.config.js +++ b/packages/docs/site/docusaurus.config.js @@ -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 = { @@ -54,6 +55,7 @@ const config = { to: '/', from: '/docs/start-here', }, + ...redirections, ], createRedirects(existingPath) { if (!existingPath.startsWith('/docs')) { @@ -198,7 +200,7 @@ const config = { }, }), }; - +console.log(JSON.stringify(config, null, 2)); module.exports = config; /** diff --git a/packages/docs/site/redirections.js b/packages/docs/site/redirections.js new file mode 100644 index 0000000000..49bbdfd451 --- /dev/null +++ b/packages/docs/site/redirections.js @@ -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; From 274c529302ff4a15cd04c10e16e73e5334e2f9aa Mon Sep 17 00:00:00 2001 From: JuanMa Garrido Date: Thu, 12 Sep 2024 19:00:30 +0200 Subject: [PATCH 2/2] removed console.log --- packages/docs/site/docusaurus.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/docs/site/docusaurus.config.js b/packages/docs/site/docusaurus.config.js index e5b2414f01..143ead2301 100644 --- a/packages/docs/site/docusaurus.config.js +++ b/packages/docs/site/docusaurus.config.js @@ -200,7 +200,7 @@ const config = { }, }), }; -console.log(JSON.stringify(config, null, 2)); + module.exports = config; /**