Skip to content

Commit ba661d6

Browse files
committed
do not create this redirect for deprecated enterprise versions
1 parent bad5bb0 commit ba661d6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/redirects/get-old-paths-from-permalink.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { latest, lastReleaseWithLegacyFormat } = require('../enterprise-server-releases')
1+
const { latest, deprecated, lastReleaseWithLegacyFormat } = require('../enterprise-server-releases')
22
const { getPathWithoutLanguage, getPathWithLanguage, getVersionStringFromPath } = require('../path-utils')
33
const patterns = require('../patterns')
44
const versionSatisfiesRange = require('../version-satisfies-range')
@@ -15,7 +15,7 @@ module.exports = function getOldPathsFromPath (currentPath, languageCode, curren
1515

1616
// This only applies to Dotcom paths, so no need to determine whether the version is deprecated
1717
// create old path /free-pro-team@latest/github from new path /github (or from a frontmatter `redirect_from` path like /articles)
18-
if (versionFromPath === 'homepage' || !currentlySupportedVersions.includes(versionFromPath) || (versionFromPath === nonEnterpriseDefaultVersion && !currentPath.includes(nonEnterpriseDefaultVersion))) {
18+
if (versionFromPath === 'homepage' || !(currentlySupportedVersions.includes(versionFromPath) || deprecated.includes(versionFromPath)) || (versionFromPath === nonEnterpriseDefaultVersion && !currentPath.includes(nonEnterpriseDefaultVersion))) {
1919
oldPaths.add(currentPath
2020
.replace(`/${languageCode}`, `/${languageCode}/${nonEnterpriseDefaultVersion}`))
2121
}

0 commit comments

Comments
 (0)