Skip to content

Commit 7c15750

Browse files
committed
account for lang code now being part of siteTree paths
1 parent cac0ccf commit 7c15750

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

middleware/early-access-breadcrumbs.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ module.exports = async (req, res, next) => {
4040

4141
// get Early Access category path
4242
// e.g., `enforcing-best-practices-with-github-policies` in /free-pro-team@latest/early-access/github/enforcing-best-practices-with-github-policies
43-
const categoryPath = path.posix.join('/', req.context.currentVersion, 'early-access', pathParts[0], pathParts[1])
44-
const category = req.context.pages[path.posix.join('/en', categoryPath)]
43+
const categoryPath = path.posix.join('/', 'en', req.context.currentVersion, 'early-access', pathParts[0], pathParts[1])
44+
const category = req.context.pages[categoryPath]
4545

4646
if (!category) return next()
4747

@@ -54,7 +54,7 @@ module.exports = async (req, res, next) => {
5454

5555
// for Early Access purposes, we don't need to differentiate between map topics and articles breadcrumbs
5656
const mapTopicOrArticlePath = path.posix.join(categoryPath, pathParts[2])
57-
const mapTopicOrArticle = req.context.pages[path.posix.join('/en', mapTopicOrArticlePath)]
57+
const mapTopicOrArticle = req.context.pages[mapTopicOrArticlePath]
5858

5959
if (!mapTopicOrArticle) return next()
6060

0 commit comments

Comments
 (0)