1
0
mirror of synced 2025-12-21 19:06:49 -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

@@ -6,6 +6,7 @@ const allVersions = Object.keys(require('./all-versions'))
const { getVersionStringFromPath } = require('./path-utils')
const getApplicableVersions = require('./get-applicable-versions')
const findPage = require('./find-page')
const removeFPTFromPath = require('./remove-fpt-from-path')
// This module builds a localized tree of every page on the site
// It includes single-source pages that have different variants
@@ -47,7 +48,7 @@ module.exports = async function buildSiteTree (pageMap, site, redirects) {
// item.hrefs have a default version via lib/all-products, so update to the current version
const versionFromPath = getVersionStringFromPath(item.href)
const versionedProductHref = path.join('/', languageCode, item.href.replace(versionFromPath, version))
const versionedProductHref = removeFPTFromPath(path.join('/', languageCode, item.href.replace(versionFromPath, version)))
product.categories = buildCategoriesTree(page.tocItems, versionedProductHref, pageMap, redirects, version)