Skip to content

Commit 308e626

Browse files
committed
use path.join instead of string interpolation for consistency
1 parent 3973df5 commit 308e626

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

lib/all-products.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ sortedProductIds.forEach(productId => {
4646
const toc = slash(path.join(dir, 'index.md'))
4747
const { data } = frontmatter(fs.readFileSync(toc, 'utf8'))
4848
const applicableVersions = getApplicableVersions(data.versions, toc)
49-
const href = `/${applicableVersions[0]}/${productId}`
49+
const href = slash(path.join('/', applicableVersions[0], productId))
5050

5151
internalProducts[productId] = {
5252
id: productId,

lib/all-versions.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ const versionDelimiter = '@'
77
const latestNonNumberedRelease = 'latest'
88

99
const plans = [
10-
{ // free-pro-team is **not** a user-facing version and is stripped from URLs.
11-
// See lib/remove-fpt-from-path.js for details.
10+
{
1211
plan: 'free-pro-team',
1312
planTitle: 'Free, Pro, and Team',
1413
releases: [latestNonNumberedRelease],

lib/redirects/get-docs-path-from-developer-path.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const path = require('path')
12
const patterns = require('../patterns')
23
const { latest } = require('../enterprise-server-releases')
34
const { getPathWithoutLanguage, getPathWithoutVersion } = require('../path-utils')
@@ -73,7 +74,7 @@ module.exports = function getDocsPathFromDeveloperPath (oldDeveloperPath, allRed
7374

7475
// old developer routes that include 'enterprise-admin' should always redirect to enterprise server
7576
if (fragment && newPath.includes('/rest/reference/enterprise-admin') && !patterns.enterpriseServer.test(newPath)) {
76-
newPath = `/en/enterprise-server@${latest}${getPathWithoutLanguage(getPathWithoutVersion(newPath))}`
77+
newPath = path.join('/en', `enterprise-server@${latest}`, getPathWithoutLanguage(getPathWithoutVersion(newPath)))
7778
}
7879

7980
// show an error if the page to be redirected to doesn't exist

0 commit comments

Comments
 (0)