Skip to content
Merged
Changes from all commits
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
15 changes: 12 additions & 3 deletions redirects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,15 @@ function generateDocsRedirects(basePath: string): RedirectRule[] {
{ from: withBase('/audit-logging'), to: withBase('/administration/logging/audit-logging') },
{ from: withBase('/jobs'), to: withBase('/administration/jobs') },
{ from: withBase('/upgrade-hdb-instance'), to: withBase('/deployments/upgrade-hdb-instance') },
{ from: withBase('/reference'), to: withBase('/reference/') },
{ from: withBase('/operations-api'), to: withBase('/developers/operations-api/') },
{ from: withBase('/rest'), to: withBase('/developers/rest') },
{ from: withBase('/api'), to: withBase('/developers/operations-api/') },

// File rename redirect
{ from: withBase('/administration/logging/logging'), to: withBase('/administration/logging/standard-logging') }
{ from: withBase('/administration/logging/logging'), to: withBase('/administration/logging/standard-logging') },

// Old Technical Details -> Reference paths
{ from: withBase('/technical-details/reference'), to: withBase('/reference/') }
);

return redirects;
Expand Down Expand Up @@ -264,12 +266,19 @@ export function createRedirects(existingPath: string, basePath: string = ''): st
}
}

// Old Technical Details -> Reference paths
if (existingPath.startsWith(`${basePath}/reference/`)) {
const subpath = existingPath.replace(`${basePath}/reference/`, '');
if (subpath) {
redirects.push(`${basePath}/technical-details/reference/${subpath}`);
}
}

// Don't create wildcard redirects for these as they're all explicitly defined:
// - /developers/security/* (all subpaths are explicit)
// - /deployments/harper-cli (explicit)
// - /developers/sql-guide/* (has explicit redirect)
// - /developers/operations-api/* (has explicit redirects)
// - /reference/* (has explicit redirect)

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