1
0
mirror of synced 2025-12-23 21:07:12 -05:00

add remove-fpt helper function

This commit is contained in:
Sarah Schneider
2021-01-14 13:34:32 -05:00
parent 927ead1d5f
commit b511758057
12 changed files with 42 additions and 37 deletions

View File

@@ -9,6 +9,7 @@ const nonEnterpriseDefaultVersion = require('./non-enterprise-default-version')
const allVersions = require('./all-versions')
const supportedVersions = Object.keys(allVersions)
const supportedPlans = Object.values(allVersions).map(v => v.plan)
const removeFPTFromPath = require('./remove-fpt-from-path')
// Content authors write links like `/some/article/path`, but they need to be
// rewritten on the fly to match the current language and page version
@@ -79,7 +80,7 @@ function getNewHref (link, languageCode, version) {
// ------ END ONE-OFF OVERRIDES ------//
// update the version in the link
newHref = newHref.replace(versionFromHref, version)
newHref = removeFPTFromPath(newHref.replace(versionFromHref, version))
}
newHref = newHref.replace(patterns.trailingSlash, '$1')