Skip to content

Commit

Permalink
Don't show hidden items with '/articles' (github#25441)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsese authored Feb 16, 2022
1 parent f3f12f7 commit c200473
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion middleware/contextualizers/generic-toc.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ export default async function genericToc(req, res, next) {
)

// Do not include hidden child items on a TOC page unless it's an Early Access category page.
// We need to account for the extra 'articles' segment with Early Access as well, we don't
// want to show hidden child items in that case.
req.context.showHiddenTocItems =
(req.context.page.documentType === 'category' &&
req.context.currentPath.includes('/early-access/')) ||
req.context.currentPath.includes('/early-access/') &&
!req.context.currentPath.endsWith('/articles')) ||
(req.context.page.documentType === 'product' &&
req.context.currentPath.includes('/early-access/') &&
req.context.page.shortTitle === 'GitHub Insights')
Expand Down

0 comments on commit c200473

Please sign in to comment.