Skip to content

Commit 0762631

Browse files
committed
include redirects from old version paths
1 parent ed9f804 commit 0762631

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

script/archive-enterprise-version.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,12 @@ async function createRedirectPages (permalinks, pages, finalDirectory) {
162162
const redirects = await loadRedirects(pagesPerVersion)
163163

164164
Object.entries(redirects).forEach(([oldPath, newPath]) => {
165-
// replace any liquid variables with the version number
166-
oldPath = oldPath.replace('{{ page.version }}', version)
165+
// remove any liquid variables that sneak in
166+
oldPath = oldPath
167+
.replace('/{{ page.version }}', '')
168+
.replace('/{{ currentVersion }}', '')
167169
// ignore any old paths that are not in this version
168-
if (!oldPath.includes(`/enterprise-server@${version}`)) return
170+
if (!(oldPath.includes(`/enterprise-server@${version}`) || oldPath.includes(`/enterprise/${version}`))) return
169171

170172
const fullPath = path.join(finalDirectory, oldPath)
171173
const filename = `${fullPath}/index.html`

0 commit comments

Comments
 (0)