Skip to content

Commit 8fd732b

Browse files
authored
Merge pull request #289 from HarperDB/fix/redirect-old-reference-paths
Fix References redirects
2 parents 90e5971 + eb959b0 commit 8fd732b

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

redirects.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,15 @@ function generateDocsRedirects(basePath: string): RedirectRule[] {
170170
{ from: withBase('/audit-logging'), to: withBase('/administration/logging/audit-logging') },
171171
{ from: withBase('/jobs'), to: withBase('/administration/jobs') },
172172
{ from: withBase('/upgrade-hdb-instance'), to: withBase('/deployments/upgrade-hdb-instance') },
173-
{ from: withBase('/reference'), to: withBase('/reference/') },
174173
{ from: withBase('/operations-api'), to: withBase('/developers/operations-api/') },
175174
{ from: withBase('/rest'), to: withBase('/developers/rest') },
176175
{ from: withBase('/api'), to: withBase('/developers/operations-api/') },
177176

178177
// File rename redirect
179-
{ from: withBase('/administration/logging/logging'), to: withBase('/administration/logging/standard-logging') }
178+
{ from: withBase('/administration/logging/logging'), to: withBase('/administration/logging/standard-logging') },
179+
180+
// Old Technical Details -> Reference paths
181+
{ from: withBase('/technical-details/reference'), to: withBase('/reference/') }
180182
);
181183

182184
return redirects;
@@ -264,12 +266,19 @@ export function createRedirects(existingPath: string, basePath: string = ''): st
264266
}
265267
}
266268

269+
// Old Technical Details -> Reference paths
270+
if (existingPath.startsWith(`${basePath}/reference/`)) {
271+
const subpath = existingPath.replace(`${basePath}/reference/`, '');
272+
if (subpath) {
273+
redirects.push(`${basePath}/technical-details/reference/${subpath}`);
274+
}
275+
}
276+
267277
// Don't create wildcard redirects for these as they're all explicitly defined:
268278
// - /developers/security/* (all subpaths are explicit)
269279
// - /deployments/harper-cli (explicit)
270280
// - /developers/sql-guide/* (has explicit redirect)
271281
// - /developers/operations-api/* (has explicit redirects)
272-
// - /reference/* (has explicit redirect)
273282

274283
return redirects.length > 0 ? redirects : undefined;
275284
}

0 commit comments

Comments
 (0)