Skip to content

Commit cac7b81

Browse files
committed
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.
1 parent a422e02 commit cac7b81

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

app-links.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,27 +90,27 @@ export const appLinks = [
9090
},
9191
{
9292
from: '/app-links/auto-space-detection',
93-
to: '/docs/editing-text/#auto-space-detection',
93+
to: '/docs/editing-text#auto-space-detection',
9494
},
9595
{
9696
from: '/app-links/html-lint',
97-
to: '/docs/Features/Problems Panel/html-lint/',
97+
to: '/docs/Features/Problems Panel/html-lint',
9898
},
9999
{
100100
from: '/app-links/ESLint',
101-
to: '/docs/Features/Problems Panel/ESLint/',
101+
to: '/docs/Features/Problems Panel/ESLint',
102102
},
103103
{
104104
from: '/app-links/live-preview-settings',
105105
to: '/docs/Features/Live Preview/live-preview-settings',
106106
},
107107
{
108108
from: '/app-links/editor-rulers',
109-
to: '/docs/Features/editor-rulers/',
109+
to: '/docs/Features/editor-rulers',
110110
},
111111
{
112112
from: '/app-links/find-in-files',
113-
to: '/docs/Features/find-in-files/',
113+
to: '/docs/Features/find-in-files',
114114
},
115115
{
116116
from: '/app-links/custom-snippets',

docusaurus.config.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,17 @@ const config = {
157157
[
158158
"@docusaurus/plugin-client-redirects",
159159
{
160-
redirects: appLinks,
160+
redirects: [
161+
...appLinks,
162+
{ from: '/docs/Features/recent-files', to: '/docs/file-management#recent-files' },
163+
{ from: '/docs/Features/live-preview-settings', to: '/docs/Features/Live Preview/live-preview-settings' },
164+
],
165+
createRedirects(existingPath) {
166+
if (existingPath !== '/') {
167+
return [existingPath + '/'];
168+
}
169+
return [];
170+
},
161171
}
162172
]
163173
],

0 commit comments

Comments
 (0)