@@ -1,12 +1,12 @@
|
||||
import { languageKeys } from './languages.js'
|
||||
import nonEnterpriseDefaultVersion from './non-enterprise-default-version.js'
|
||||
|
||||
import { allVersions } from './all-versions.js'
|
||||
import {
|
||||
latest,
|
||||
supported,
|
||||
deprecatedWithFunctionalRedirects,
|
||||
} from './enterprise-server-releases.js'
|
||||
import { getPathWithLanguage } from './path-utils.js'
|
||||
|
||||
const languagePrefixRegex = new RegExp(`^/(${languageKeys.join('|')})/`)
|
||||
const nonEnterpriseDefaultVersionPrefix = `/${nonEnterpriseDefaultVersion}`
|
||||
@@ -33,7 +33,7 @@ export default function getRedirect(uri, context) {
|
||||
|
||||
// `redirects` is sourced from more than one thing. The primary use
|
||||
// case is gathering up the `redirect_from` frontmatter key.
|
||||
// But we also has `developer.json` which contains legacy redirects.
|
||||
// But we also have `developer.json` which contains legacy redirects.
|
||||
// For example, the `developer.json` will have entries such
|
||||
// `/enterprise/v4/enum/auditlogorderfield` which clearly is using
|
||||
// the old formatting of the version. So to leverage the redirects
|
||||
@@ -43,7 +43,7 @@ export default function getRedirect(uri, context) {
|
||||
if (redirects[withoutLanguage].includes('://')) {
|
||||
return redirects[withoutLanguage]
|
||||
}
|
||||
return `/${language}` + redirects[withoutLanguage]
|
||||
return getPathWithLanguage(redirects[withoutLanguage], language)
|
||||
}
|
||||
|
||||
let basicCorrection
|
||||
|
||||
Reference in New Issue
Block a user