1
0
mirror of synced 2025-12-22 19:34:15 -05:00

support a "hierarchy of fallbacks" for versioned redirects

This commit is contained in:
Sarah Schneider
2022-04-27 17:56:28 -04:00
parent 1ad40db642
commit c089e61389
4 changed files with 34 additions and 601 deletions

View File

@@ -6,6 +6,12 @@ import enterpriseServerReleases from './enterprise-server-releases.js'
const versionDelimiter = '@'
const latestNonNumberedRelease = 'latest'
// Note this array is **in order** of the versions the site should try to fall back to if
// no version is provided in a URL. For example, if /foo refers to a page that is available
// in all versions, we should not redirect it (because /foo is the correct FPT versioned URL).
// But if /foo refers to a page that is only available in GHEC and GHES, we should redirect it
// to /enterprise-cloud@latest/foo (since GHEC comes first in the hierarchy of version fallbacks).
// The implementation lives in lib/redirects/permalinks.js.
const plans = [
{
// free-pro-team is **not** a user-facing version and is stripped from URLs.