(req, res, next)
| 1 | export default function breadcrumbs(req, res, next) { |
| 2 | if (!req.context.page) return next() |
| 3 | const isEarlyAccess = req.context.page.relativePath.startsWith('early-access') |
| 4 | if (req.context.page.hidden && !isEarlyAccess) return next() |
| 5 | |
| 6 | req.context.breadcrumbs = [] |
| 7 | |
| 8 | // Return an empty array on the landing page. |
| 9 | if (req.context.page.documentType === 'homepage') { |
| 10 | return next() |
| 11 | } |
| 12 | |
| 13 | req.context.breadcrumbs = getBreadcrumbs(req, isEarlyAccess) |
| 14 | |
| 15 | return next() |
| 16 | } |
| 17 | |
| 18 | const earlyAccessExceptions = ['insights', 'enterprise-importer'] |
| 19 |
nothing calls this directly
no test coverage detected