Skip to content

Commit 218ac32

Browse files
authored
Merge pull request #17922 from github/version-sidebar-product-links
Version sidebar product links
2 parents 80a894a + 4c3a1ee commit 218ac32

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

lib/site-tree.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ module.exports = async function buildSiteTree (pageMap, site, redirects) {
3737
return
3838
}
3939

40-
product.href = path.posix.join('/', languageCode, item.href)
41-
4240
// find the product TOC page so we have access to the TOC items
4341
const page = findPage(item.href, pageMap, redirects)
4442

@@ -47,9 +45,9 @@ module.exports = async function buildSiteTree (pageMap, site, redirects) {
4745
if (!getApplicableVersions(page.versions).includes(version)) return
4846

4947
// item.hrefs have a default version via lib/all-products, so update to the current version
50-
const versionedProductHref = removeFPTFromPath(path.join('/', languageCode, version, getPathWithoutVersion(item.href)))
48+
product.href = removeFPTFromPath(path.join('/', languageCode, version, getPathWithoutVersion(item.href)))
5149

52-
product.categories = buildCategoriesTree(page.tocItems, versionedProductHref, pageMap, redirects, version)
50+
product.categories = buildCategoriesTree(page.tocItems, product.href, pageMap, redirects, version)
5351

5452
productTree[item.id] = product
5553
return null

0 commit comments

Comments
 (0)