From b1f1e1cb6af650af126479ff32521d470f23f966 Mon Sep 17 00:00:00 2001 From: Jeff McAffer Date: Thu, 8 Oct 2020 19:20:27 -0700 Subject: [PATCH 1/2] correct for windows slashes in redirect `precompile` --- lib/redirects/precompile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/redirects/precompile.js b/lib/redirects/precompile.js index 97cd39cacba5..736252506726 100755 --- a/lib/redirects/precompile.js +++ b/lib/redirects/precompile.js @@ -85,7 +85,7 @@ module.exports = async function precompileRedirects (pages) { // add a veriation like `/free-pro-team@latest/v3/gists/comments`; // again, we need to do this because all links in content get rewritten if (!developerRoute.startsWith('/enterprise/')) { - const developerRouteWithVersion = path.join(nonEnterpriseDefaultVersion, developerRoute) + const developerRouteWithVersion = slash(path.join(nonEnterpriseDefaultVersion, developerRoute)) const developerRouteWithVersionAndLanguage = `/en/${developerRouteWithVersion}` allRedirects[developerRouteWithVersion] = newPath allRedirects[developerRouteWithVersionAndLanguage] = newPath From d16c1f2087e898f41903b4edc8fc5fde8e0d7393 Mon Sep 17 00:00:00 2001 From: Jeff McAffer Date: Thu, 8 Oct 2020 19:59:15 -0700 Subject: [PATCH 2/2] add missing slash require --- lib/redirects/precompile.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/redirects/precompile.js b/lib/redirects/precompile.js index 736252506726..91f57591efbf 100755 --- a/lib/redirects/precompile.js +++ b/lib/redirects/precompile.js @@ -1,4 +1,5 @@ const path = require('path') +const slash = require('slash') const patterns = require('../patterns') const { latest } = require('../enterprise-server-releases') const getOldPathsFromPermalink = require('../redirects/get-old-paths-from-permalink')