1
0
mirror of synced 2026-01-23 03:01:22 -05:00

Merge pull request #7483 from github/repo-sync

repo sync
This commit is contained in:
Octomerger Bot
2021-06-18 05:53:08 +10:00
committed by GitHub

View File

@@ -8,29 +8,29 @@ const { FEATURE_NEXTJS } = process.env;
const enabledSubSections = [
// 'actions',
// 'admin',
// "billing",
"billing",
// "code-security",
// "codespaces",
// "communities",
// "desktop",
// "developers",
// "discussions",
"discussions",
// 'early-access',
// "education",
// 'github',
// "graphql",
// 'insights',
// "issues",
// "organizations",
"organizations",
// 'packages',
// "pages",
// "rest",
// "sponsors",
"sponsors",
];
const homePageExp = pathToRegexp('/:locale/:versionId?')
const productPageExp = pathToRegexp('/:locale/:versionId?/:productId')
const subSectionExp = pathToRegexp('/:locale/:versionId?/:productId/:subSection')
const subSectionExp = pathToRegexp('/:locale/:versionId?/:productId/:subSection*')
module.exports = function isNextRequest(req, res, next) {
req.renderWithNextjs = false;
@@ -53,7 +53,8 @@ module.exports = function isNextRequest(req, res, next) {
} else if (productPageMatch && productIds.includes(productPageMatch[3])) {
req.renderWithNextjs = true
} else if (subSectionMatch) {
req.renderWithNextjs = enabledSubSections.includes(subSectionMatch[4])
// depending on whether versionId is included the productId is in a different place
req.renderWithNextjs = enabledSubSections.includes(subSectionMatch[2]) || enabledSubSections.includes(subSectionMatch[3])
}
}
}