From cac7b815cd6fe46c01d62e4e01e9ec88f348e798 Mon Sep 17 00:00:00 2001 From: Charly Abraham Date: Thu, 12 Mar 2026 14:55:52 +0530 Subject: [PATCH] fix: resolve GSC 404 errors with trailing-slash redirects and moved-page redirects Add createRedirects to generate trailing-slash redirect pages for GitHub Pages compatibility. Add explicit redirects for /docs/Features/recent-files and /docs/Features/live-preview-settings. Fix 5 trailing-slash targets in app-links.js. --- app-links.js | 10 +++++----- docusaurus.config.js | 12 +++++++++++- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/app-links.js b/app-links.js index 1c2b61ca..39e31f06 100644 --- a/app-links.js +++ b/app-links.js @@ -90,15 +90,15 @@ export const appLinks = [ }, { from: '/app-links/auto-space-detection', - to: '/docs/editing-text/#auto-space-detection', + to: '/docs/editing-text#auto-space-detection', }, { from: '/app-links/html-lint', - to: '/docs/Features/Problems Panel/html-lint/', + to: '/docs/Features/Problems Panel/html-lint', }, { from: '/app-links/ESLint', - to: '/docs/Features/Problems Panel/ESLint/', + to: '/docs/Features/Problems Panel/ESLint', }, { from: '/app-links/live-preview-settings', @@ -106,11 +106,11 @@ export const appLinks = [ }, { from: '/app-links/editor-rulers', - to: '/docs/Features/editor-rulers/', + to: '/docs/Features/editor-rulers', }, { from: '/app-links/find-in-files', - to: '/docs/Features/find-in-files/', + to: '/docs/Features/find-in-files', }, { from: '/app-links/custom-snippets', diff --git a/docusaurus.config.js b/docusaurus.config.js index dfa2e7f8..0d54856f 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -157,7 +157,17 @@ const config = { [ "@docusaurus/plugin-client-redirects", { - redirects: appLinks, + redirects: [ + ...appLinks, + { from: '/docs/Features/recent-files', to: '/docs/file-management#recent-files' }, + { from: '/docs/Features/live-preview-settings', to: '/docs/Features/Live Preview/live-preview-settings' }, + ], + createRedirects(existingPath) { + if (existingPath !== '/') { + return [existingPath + '/']; + } + return []; + }, } ] ],