diff --git a/lib/old-versions-utils.js b/lib/old-versions-utils.js index f17ad8c4c3..d234ef49e0 100644 --- a/lib/old-versions-utils.js +++ b/lib/old-versions-utils.js @@ -67,7 +67,7 @@ function getNewVersionedPath (oldPath, languageCode = '') { const restOfString = oldPath.replace(patterns.oldEnterprisePath, '') // Add the language and new version to the product part of the string - return path.join('/', languageCode, newVersion, restOfString) + return path.posix.join('/', languageCode, newVersion, restOfString) } module.exports = { diff --git a/lib/permalink.js b/lib/permalink.js index 8ac4852080..241f33bb0d 100644 --- a/lib/permalink.js +++ b/lib/permalink.js @@ -15,7 +15,7 @@ class Permalink { const permalinkSuffix = this.constructor.relativePathToSuffix(relativePath) - this.href = removeFPTFromPath(path.join('/', languageCode, pageVersion, permalinkSuffix)) + this.href = removeFPTFromPath(path.posix.join('/', languageCode, pageVersion, permalinkSuffix)) .replace(patterns.trailingSlash, '$1') this.pageVersionTitle = allVersions[pageVersion].versionTitle diff --git a/lib/redirects/get-docs-path-from-developer-path.js b/lib/redirects/get-docs-path-from-developer-path.js index bf7f0a0b5d..77f6930b83 100644 --- a/lib/redirects/get-docs-path-from-developer-path.js +++ b/lib/redirects/get-docs-path-from-developer-path.js @@ -74,7 +74,7 @@ module.exports = function getDocsPathFromDeveloperPath (oldDeveloperPath, allRed // old developer routes that include 'enterprise-admin' should always redirect to enterprise server if (fragment && newPath.includes('/rest/reference/enterprise-admin') && !patterns.enterpriseServer.test(newPath)) { - newPath = path.join('/en', `enterprise-server@${latest}`, getPathWithoutLanguage(getPathWithoutVersion(newPath))) + newPath = path.posix.join('/en', `enterprise-server@${latest}`, getPathWithoutLanguage(getPathWithoutVersion(newPath))) } // show an error if the page to be redirected to doesn't exist diff --git a/lib/redirects/permalinks.js b/lib/redirects/permalinks.js index b4fffb4cee..d6c91dd307 100644 --- a/lib/redirects/permalinks.js +++ b/lib/redirects/permalinks.js @@ -36,7 +36,7 @@ module.exports = function generateRedirectsForPermalinks (permalinks, redirectFr } // get the old path for the current permalink version - let versionedFrontmatterOldPath = path.join('/', permalink.languageCode, getNewVersionedPath(frontmatterOldPath)) + let versionedFrontmatterOldPath = path.posix.join('/', permalink.languageCode, getNewVersionedPath(frontmatterOldPath)) const versionFromPath = getVersionStringFromPath(versionedFrontmatterOldPath) versionedFrontmatterOldPath = removeFPTFromPath(versionedFrontmatterOldPath.replace(versionFromPath, permalink.pageVersion)) diff --git a/lib/rewrite-local-links.js b/lib/rewrite-local-links.js index 76e30b6264..947c684684 100644 --- a/lib/rewrite-local-links.js +++ b/lib/rewrite-local-links.js @@ -52,7 +52,7 @@ function getNewHref (link, languageCode, version) { const hrefWithoutLang = getPathWithoutLanguage(href) // normalize any legacy links so they conform to new link structure - newHref = path.join('/', languageCode, getNewVersionedPath(hrefWithoutLang)) + newHref = path.posix.join('/', languageCode, getNewVersionedPath(hrefWithoutLang)) // get the current version from the link const versionFromHref = getVersionStringFromPath(newHref) diff --git a/lib/site-tree.js b/lib/site-tree.js index 99eb62ff6b..8190ebd48e 100644 --- a/lib/site-tree.js +++ b/lib/site-tree.js @@ -37,7 +37,7 @@ module.exports = async function buildSiteTree (pageMap, site, redirects) { return } - product.href = path.join('/', languageCode, item.href) + product.href = path.posix.join('/', languageCode, item.href) // find the product TOC page so we have access to the TOC items const page = findPage(item.href, pageMap, redirects) @@ -71,7 +71,7 @@ function buildCategoriesTree (tocItems, versionedProductHref, pageMap, redirects tocItems.forEach(item => { const category = {} - category.href = path.join(versionedProductHref, item.href) + category.href = path.posix.join(versionedProductHref, item.href) // find the category TOC page and get its TOC items const page = findPage(category.href, pageMap, redirects) @@ -115,7 +115,7 @@ function buildMaptopicsTree (tocItems, versionedCategoryHref, pageMap, redirects .forEach(item => { const maptopic = {} - maptopic.href = path.join(versionedCategoryHref, item.href) + maptopic.href = path.posix.join(versionedCategoryHref, item.href) // find the category TOC page and get its TOC items const page = findPage(maptopic.href, pageMap, redirects) @@ -150,7 +150,7 @@ function buildArticlesTree (tocItems, versionedCategoryHref, pageMap, redirects, tocItems.forEach(item => { const article = {} - article.href = path.join(versionedCategoryHref, item.href) + article.href = path.posix.join(versionedCategoryHref, item.href) // find the category TOC page and get its TOC items const page = findPage(article.href, pageMap, redirects)