@@ -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])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user