change path.join to path.posix.join for Windows friendliness
This commit is contained in:
@@ -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 = {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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))
|
||||
|
||||
|
||||
47861
lib/redirects/static/archived-redirects.json
Normal file
47861
lib/redirects/static/archived-redirects.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user